Opening a Unidirectional Pipe Using popen() : popen « File Directory « PHP






Opening a Unidirectional Pipe Using popen()

 
<?php
        $pr1 = popen('ls', 'r');
        echo fread($pr1, 1024);

        $pr2 = popen('php', 'w');
        fputs($pr2, '<?php touch("myfile.txt"); ?>');
?>
  
  








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.Redirecting standard output
8.Reading standard error