I'm new to php and am trying to bring in code from a text list in REVERSE order. I understand that I need to use ksort, but apparenlty am not understanding where to use this. The code below works, but what I'd like it to do is list the most recently added items at top. I tried ksort($name) before the echo "a href..." statement. It didn't work. I know I'm missing something. Trying to figure it out. Like I said-- just learning. Thanks in advance.
[PHP]
<?php
$text = (file("http://www.brewerthomp son.com/classes/sitesee/sites.txt"));
echo '<ul>';
for($i = 0; $i < count($text); $i++)
{
$name=trim($tex t[$i]) ;
echo "<li><a href='http://".$name."' target='_blank' >".$name."</a></li>";
}
?>
[/PHP]
[PHP]
<?php
$text = (file("http://www.brewerthomp son.com/classes/sitesee/sites.txt"));
echo '<ul>';
for($i = 0; $i < count($text); $i++)
{
$name=trim($tex t[$i]) ;
echo "<li><a href='http://".$name."' target='_blank' >".$name."</a></li>";
}
?>
[/PHP]
Comment