Chopping up a comand line return.
| From: | stankusn | Date: | Fri, 02 Feb 2001 15:01:36 +0000 |
| Subject: | Chopping up a comand line return. | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-37843@lists.php.net to get a copy of this message | ||
Here is my problem,
I want to read the contents of a dir, on a linux machine, in proper order
according to date (ie. from newest to oldest). My problem is I know how to
do it in perl....but not in php. I tried what I use is perl and it doesn't
work. Here is what I have that does work.
$stuff =
ls -C1t /your/dir/to/read/from/$author/; ---works
now I want to parse up $stuff to get the 10 or so files names so I can link
to them. I just
cannot figure out how to do it in php.
This is how I would do it in perl/CGI
@stuff = same as above
foreach $filename (@stuff){
next if $filename !~ /(inc$/i;
print = "<a href=\"$author/$filename\">$filename</a>";
}
I need something pretty much the same in php...I just don't know why it
isn't working quite the same......
thanks for your time in advance.,
nixter
-----------------------------------------------------------
Nick.Stankus
Software Engineer
Logicon/Sterling Federal
402-232-7870
-----------------------------------------------------------
"There are two things that are infinite; Human stupidity and the
universe. And I'm not sure about the universe." - Albert Einstein