Re: Newbie... Executing UNIX commands...
| From: | Jack Dempsey | Date: | Thu, 10 May 2001 07:42:34 +0000 |
| Subject: | Re: Newbie... Executing UNIX commands... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-52239@lists.php.net to get a copy of this message | ||
for your specific example, check out
http://www.php.net/manual/en/function.readdir.php
lots of simple functions like that have already been written for
you...the joy of php ;-)
-jack
macky wrote:
>
> im using PHP + APACHE on Linux Box
>
> i wonder what command in PHP can i use to execute Unix commands....
>
> i got to read also exec(), system(), passthru(),popen(), and
> excapeshellcmd()
>
> but what if i want to use the command "ls" and store ALL output in a
> variable....
>
> i thought system() is enough.... but system function outputs the result on
> the page...
>
> actual code:
> <%php
> $var = system("ls /tmp/");
> %>
>
> if u can see no "echo" command..
>
> lastly is there a possibility that resulting output from "ls" will be placed
> in a list... or array.....(since PHP doesnt have list)
>
> : (
>
> thanks in advance
>
> --
> ----------------------------------------------------------------------
> The information contained in this message (including any attachments)
> is confidential and intended solely for the attention and use of the
> named addressee(s). It must not be copied, distributed nor disclosed
> to any person. If you are not the intended recipient, please delete
> it from your system and notify sender immediately. Any disclosure,
> copying or distribution thereof or any action taken or omitted to be
> taken in reliance thereon is prohibited and may be unlawful.
> ----------------------------------------------------------------------
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net