ランダムな文字列作成
2021/11/06
PHP5.3.3
function get_random_string($nLengthRequired = 8){
$sCharList = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
mt_srand();
$sRes = "";
for($i = 0; $i < $nLengthRequired; $i++)
$sRes .= $sCharList[mt_rand(0, strlen($sCharList) - 1)];
return $sRes;
}