- substr: documentation ( source)
- str_repeat: documentation ( source)
- str_shuffle: documentation ( source)
<?php
function quickRandom($length = 16) {
$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
return substr(str_shuffle(str_repeat($pool, 5)), 0, $length);
}
echo strlen(quickRandom(311));