amend proc_open example

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@78064 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Wez Furlong 2002-04-13 11:13:02 +00:00
parent a59df78205
commit 3787ef5bb9

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.28 $ -->
<!-- $Revision: 1.29 $ -->
<reference id="ref.exec">
<title>Program Execution functions</title>
<titleabbrev>Program Execution</titleabbrev>
@ -282,11 +282,14 @@ if (is_resource($process)) {
// Any error output will be appended to /tmp/error-output.txt
fwrite($pipes[0], "<?php echo \"Hello World!\"; ?>");
fclose($pipes[0]);
while(!feof($pipes[1])) {
echo fgets($pipes[1], 1024);
}
fclose($pipes[1]);
// It is important that you close any pipes before calling
// proc_close in order to avoid a deadlock
$return_value = proc_close($process);
echo "command returned $return_value\n";