<?php
//隨機產生密碼
function randPassword()
{
//密碼長度
$len = 8;
//o、l、0、1容易混淆,不加入產生字元內
$Range = 'abcdefghijkmnpqrstuvwxyz23456789ABCDEFGHIJKLMNPQRSTUVWXYZ';
$StrLen = strlen($Range);
$Passwd = '';
for ($i = 0; $i < $len; $i++) {
$Passwd .= $Range[rand() % $StrLen];
}
return $Passwd;
}
echo randPassword();
?>