RE: [PHP] Newbie: Reading unix directory information from PHP
| From: | Peter | Date: | Tue, 23 Jul 2002 23:22:48 +0000 |
| Subject: | RE: [PHP] Newbie: Reading unix directory information from PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-109167@lists.php.net to get a copy of this message | ||
Hi Paul,
this should help you out
<?php
$LastLine = exec("ls -lrt", $AllOutput, $ReturnValue);
print("Last Line: $LastLine <BR>\n");
print("All Output:<BR>\n");
for ($index = 0; $index < count($AllOutput); $index++)
{
print("$AllOutput[$index] <BR>\n");
}
print("<BR><BR>\n");
print("Return Value: $ReturnValue<BR>\n");
?>
should work a treat for you ...
cheers
Peter
> -----Original Message-----
> From: Paul Oh [mailto:poh@cisco.com]
> Sent: Wednesday, 24 July 2002 9:04 AM
> To: php-general@lists.php.net
> Subject: [PHP] Newbie: Reading unix directory information from PHP
>
>
> Hi, I'm just starting to learn PHP. I couldn't find how to execute unix
> command and read the result. Basically, I just want to execute "ls -lrt"
> and read and display the output.
>
> This may be very simple question, but for some reason, I couldn't find any
> info on executing unix command from PHP.
>
> Thanks.
>
> -Paul
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>