note 9587 deleted from function.popen by felipe
| From: | felipe@php.net | Date: | Sat, 29 Dec 2007 19:03:00 +0000 |
| Subject: | note 9587 deleted from function.popen by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-134177@lists.php.net to get a copy of this message | ||
Note Submitter: stevet at linuxfan dot com
----
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);