你好,我想在重複像Ag7hlA的PHP中生成隨機字符串。反正是有做我試圖此PHP中的隨機字符串
<?php
function random_string($length)
{
$length = (int) $length;
if ($length < 1) return '';
$base = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz123456789";
$max = strlen($base) - 1;
$string = '';
while ($len--)
{
$string = $base[mt_rand(0, $max)];
}
return $string;
}
?>
但沒有產生
遵循堆棧溢出的鏈接(同樣的問題):http://stackoverflow.com/questions/4356289/php-random-string-generator?rq=1 – 2013-05-06 05:47:06