Redirecting standard output : popen « File Directory « PHP






Redirecting standard output

 
<?php
// Unix: just read standard error
$ph = popen('strace ls 2>&1 1>/dev/null','r') or die($php_errormsg);

// Windows: just read standard error
$ph = popen('ipxroute.exe 2>&1 1>NUL','r') 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.Reading output from popen()
6.Opening a Process File Pointer with popen()
7.Opening a Unidirectional Pipe Using popen()
8.Reading standard error