Try this :

<?php
 $fp = popen ("/bin/ls ", "r");
 while(!feof($fp))
 {$buffer = fgets($fp,4096);
  echo "\n<br><li>&nbsp;<a href=".chr(34).$buffer.chr(34).">".$buffer."</a>";}
 pclose($fp)
?>

s> Here is my problem,

s>   I want to read the contents of a dir, on a linux machine, in proper order
s> according to date (ie. from newest to oldest). My problem is I know how to
s> do it in perl....but not in php. I tried what I use is perl and it doesn't
s> work. Here is what I have that does work.

s> $stuff = `ls -C1t /your/dir/to/read/from/$author/`;  ---works

s> now I want to parse up $stuff to get the 10 or so files names so I can link
s> to them. I just
s> cannot figure out how to do it in php.

s> This is how I would do it in perl/CGI

s> @stuff = same as above
s> foreach $filename (@stuff){
s>     next if $filename !~ /(inc$/i;
s>     print = "<a href=\"$author/$filename\">$filename</a>";
s> }

s> I need something pretty much the same in php...I just don't know why it
s> isn't working quite the same......

s> thanks for your time in advance.,

s> nixter

s> -----------------------------------------------------------
s> Nick.Stankus
s> Software Engineer
s> Logicon/Sterling Federal
s> 402-232-7870
s> -----------------------------------------------------------
s> "There are two things that are infinite; Human stupidity and the
s> universe. And I'm not sure about the universe." - Albert Einstein
_______________________________________
Massuelles Jean-Baptiste([EMAIL PROTECTED])
Société A Comme...
Tel : 03 80 700 702



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to