How do I sort this loop? I can't sort it because I just began learning PHP, so I don't know as much as most of you users... Can anyone help me?
<?php
$red = array();
$x=0;
$min=500;
$max=2000;
echo "<table border=\"1\">";
for($row=1;$row<=20; $row++){
echo "<tr>\n";
//Need table ONE to have 20 by 20 rows & columns
//Need the table to contain numbers between 900 - 2000 (Randomly)
//Table two will take table ONE and sorts it from Smallest to Biggest
//Table three will take table ONE and sorts it from Biggest to Smallest
//Table 4 will only show a (*) net to the Odd Numbers and (#) next to the Even Numbers
for($col=1;$col<=20; $col++){
$x=rand($min,$max);
$red[$row][$col] = $x;
$blue[$row][$col]=$table[$row][$col];
echo"<td>$x</td>\n";
}
echo "</tr>";
}
echo "</table>";
$blue= array();
echo "<table border=\"1\">";
for($row=1;$row<=20; $row++){
echo "<tr>\n";
for($col=1;$col<=20;$col++){
$blue[$row][$col] = $y;
echo"<td>$y</td>\n";
}
echo "</tr>";
}
echo "</table>";
?>
Basically what is in the comments inside the code is what I need to achieve... I unfortunately can't, so please help me!!!