我是初學者,我的電子郵件激活功能有小錯誤。該錯誤位於for循環的行中。我的電子郵件激活功能中的錯誤在哪裏?
<?php
function generateCode(){
$codelength = 20;
// The length of the activation code.
$characters = "abcdefghijklmnopqrstuvwxyz1234567890"; // All accepted characters.
$activatecode = "";
for($i=0;$i<=$codelength;$i++){
$activatecode .= substr(str_shuffle($characters),0,1);
}
return $activatecode;
}
$userActivationCode = generateCode();
?>
謝謝您得到它了。 – 2013-02-28 20:40:19