running into a weird problem. i have an array reading from a dB and would like to add manually to this list then sort()
but sort seems to only apply to the while loop, why? how can i fix this?
as always any help would be appreciated, thanks.
Code:
$rows = array();
array_push($rows, 'b new item');// this gets left out
while ($row0 = mysql_fetch_array($result0))
{
array_push($rows, $row0[1]);
}
sort($rows);// only sorts the items in the while loop
foreach($rows as $r) {
$string .= "<li><a href='#'>" . $r . "</a></li>" . "\n";
}
echo $string;
Bookmarks