I am trying to display 10 random numbers from an array of numbers with no success.
This is my code:
<?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 />";
}
?>
The script doesn’t display anything although I have display_errors = On on my ubuntu php.ini.
Where am I going wrong?
I would use
shufflefunction instead.