我试图从一个数字数组中显示 10 个随机数,但没有成功。
这是我的代码:
<?php
$num = array("2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009");
//echo $num[rand(0,9)];
echo '<br/>';
for ($num = 2000; $num <= 10; $num[rand(0,9)]++)
{
echo "The number is " . $num . "<br />";
}
?>
display_errors = On
尽管我的 ubuntu php.ini 上有脚本,但该脚本没有显示任何内容。
我哪里错了?