Hello,
First of all, I should apologize for my bad English,
and I hope somebody will understand what I was trying to say..

So, the problem is, that I can't SORT or REVERSE the array.
By the way, sorry for this awful and very long php script.
And I know  that many of you guys can  make it look short, but please, if
you can repair the main problem,
try to leave this "long" script close to it's natural look. At least so that
I can understand the connection between my part of the script, and yours.
Thank you very mych!

<?php
if ($handle = opendir('news')) {
   while (false !== ($topic = readdir($handle))) {
       if ($topic != "." && $topic != "..") {

   $topic_b = array($topic); // the problem starts here.
   rsort($topic_b);
   //array_reverse($topic_b);

   foreach($topic_b as $topic_c){
   $date = $topic_c;
   }
   print($date);

}
}
   closedir($handle);
}
?>

This way, this will print:
2004.08.11
2004.08.31
2004.11.07

But I want to reverse this array, so that it would print:
2004.11.07
2004.08.31
2004.08.11

BTW, I thought that $topic is an array, but when I was tryng to reverse
$topic,
the browser said: "Warning: array_reverse(): The argument should be an
array".

Thank you once more,
Lab.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to