隨機字元產生function randStr($length=4,$type="1"){<br>
$陣列=陣列(<br>
'1' => '0123456789',<br>
'2' => 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',<br>
'3' => '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ',<br>
);<br>
$string = $array[$type];<br>
$count = strlen($string)-1;<br>
$蘭特='';<br>
for ($i = 0;$i
$rand.=$string[mt_rand(0, $count)];<br>
}<br>
返回 $rand;<br>
}