PHP Tips for easy development | Drupal 8

PHP Tips for easy development

Submitted by editor on Fri, 10/13/2017 - 10:36

Generate a random key.

$random_key = str_shuffle('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'); // 62 characters
$random_key = substr($random_key, 0, 10); // 10 characters

 

Tags

Add new comment