Str::quickRandom

Posted on November 25, 2016

Generate a “random” alpha-numeric string. Should not be considered sufficient for cryptography, etc.

Example usage

$random = Str::quickRandom();
// 16 chars long random alphanumeric string
// Q7EPToH8la5M0SDh

$random = Str::random(3);
// 3 chars long random alphanumeric string
// w4G

Parameters

int $length

Return Value

string

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *