网络营销电子商务研究中心

网络营销电子商务研究中心 (https://www.0058.net/index.php)
-   代码交流 (https://www.0058.net/forumdisplay.php?f=16)
-   -   Php随机生成字符串 (https://www.0058.net/showthread.php?t=2995)

yahoo 2008-02-01 12:02 PM

Php随机生成字符串
 
<?
function MakePass($length)
{
$possible = "0123456789!*#$%^&*()_+".
"abcdefghijklmnopqrstuvwxyz".
"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$str = "";
while(strlen($str) < $length)
{
$str .= substr($possible, (rand() % strlen($possible)), 1);
}
return($str);
}
echo $str;
?>


All times are GMT +8. The time now is 01:52 PM.

Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.