You can customize what string is generated and how long it is
[PHP] Code
Function random($length)
{
$hash = ;
$chars = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz;
$max = strlen($chars) - 1;
mt_srand((double)microtime() * 1000000);
for($i = 0; $i < $length; $i++)
{
$hash .= $chars[mt_rand(0, $max)];
}
return $hash;
}
http://www.bkjia.com/PHPjc/486024.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/486024.htmlTechArticleYou can customize what string is generated and how long it is [PHP] code function random($length) { $hash = ; $chars = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz; $max = st...
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn