Reading output from popen() : popen « File Directory « PHP






Reading output from popen()

 
<?php
$ph = popen('/sbin/route','r') or die($php_errormsg);
while (! feof($ph)) {
    $s = fgets($ph)            or die($php_errormsg);
}
pclose($ph)                    or die($php_errormsg);
?>
  
  








Related examples in the same category

1.Using popen() and pclose()
2.Using popen() to Pass Data to the column Application
3.Using popen() to Read the Output of the Unix who Command
4.Using popen() with nsupdate
5.Opening a Process File Pointer with popen()
6.Opening a Unidirectional Pipe Using popen()
7.Redirecting standard output
8.Reading standard error