最佳答案
我正在尝试在PHP中创建一个随机字符串,但我绝对没有得到任何输出:
<?phpfunction RandomString(){$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';$randstring = '';for ($i = 0; $i < 10; $i++) {$randstring = $characters[rand(0, strlen($characters))];}return $randstring;}
RandomString();echo $randstring;
我做错了什么?