note 9587 added to popen
| From: | stevet at linuxfan dot com | Date: | Tue, 14 Nov 2000 00:17:58 +0000 |
| Subject: | note 9587 added to popen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-7645@lists.php.net to get a copy of this message | ||
In PHP3, I could do:
$query = "echo hello world | mycmd"
$fp = ($query, "r");
Under PHP4, this just produces "hello world | mycmd" as the output - the pipe is not
executed.
Instead, use:
$query = "hello world";
$cmd = "mycmd";
$fp = popen($cmd, "w+");
fwrite($fp, $query);
http://www.php.net/manual/function.popen.php