|
Posted by Geoff Berrow on 02/14/07 00:16
Message-ID: <45d238b6$0$5081$ba4acef3@news.orange.fr> from Françoise
Debat contained the following:
>>
>> That's probably easiest. Might be more fun to do a bubble sort though
>> :-)
>
>I'm sorry, I don't understand how to do either. Please can you point me
>to an example I can learn from?
<?php
$path=$_SERVER['PATH_TRANSLATED'];
$dir=dirname($path);
$directory=str_replace("/","",strrchr($dir, "/"));
echo"<h2>Files in $directory</h2>\n\n";
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
//print $dir . $file;
if($file!="." && $file!=".." ){
$files[]=$file;
}
}
asort($files);
closedir($dh);
}
foreach($files as $value){
echo $value."<br>";
}
?>
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Navigation:
[Reply to this message]
|