//獲取隨機字符 此函數區分字符大小寫 如果不區分大小寫可加入函數strtolower
function genRandomString($len)
{
$chars = array(
"a"
"l"
"w"
"H"
"S"
"
);
$charsLen = count($chars)
shuffle($chars);// 將數組打亂
$output = "";
for ($i=
{
$output
}
return $output;
}
$str = genRandomString(
echo $str;
?>
From:http://tw.wingwit.com/Article/program/PHP/201311/21158.html