Re: note 33322 added to function.system
| From: | Lars Torben Wilson | Date: | Mon, 23 Jun 2003 04:05:17 +0000 |
| Subject: | Re: note 33322 added to function.system | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-50826@lists.php.net to get a copy of this message | ||
Hi Daevid,
On Sun, 2003-06-22 at 20:25, daevid@daevid.com wrote:
> Unfortunately, system() dumps the output of the command to the
> screen/page with no way to supress it. So trying to use the exit codes
> from external programs is relatively useless:
This isn't quite true. system() doesn't provide any way to suppress the
output, but the output buffering functions do:
http://www.php.net/outcontrol
And in any event, if this is the behaviour you need, use exec().
http://www.php.net/exec
Torben
> $test = system("ping -n -c 1 -w 1 -q $IP", $code);
> if ( $code == 0 )
> $this->active = true;
> else
> $this->active = false;
> ----
> Manual Page -- å”8Þ`ò
> Ȯ$c\http://www.php.net/manual/en/function.system.php
> Edit Note --
> http://master.php.net/manage/user-notes.php?action=edit+33322
> Delete Note --
> http://master.php.net/manage/user-notes.php?action=delete+33322&report=yes
> Reject Note --
> http://master.php.net/manage/user-notes.php?action=reject+33322&report=yes
--
Torben Wilson <torben@php.net> +1.604.709.0506
http://www.thebuttlesschaps.com http://www.inflatableeye.com
http://www.hybrid17.com http://www.themainonmain.com
-----==== Boycott Starbucks! http://www.haidabuckscafe.com ====-----