Random string generation
function generateRandomString($length = 10) { // to generate rendom strings
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, strlen($characters) - 1)];
}
return $randomString;
//refer :http://stackoverflow.com/questions/4356289/php-random-string-generator
}
0 comments:
Post a Comment