fronix

Untitled

Jan 27th, 2014
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.55 KB | None | 0 0
  1.     $cmd = "ping 127.0.0.1";
  2.      
  3.     $descriptorspec = array(
  4.        0 => array("pipe", "r"),  // stdin is a pipe that the child will read from  
  5.        1 => array("pipe", "w"),  // stdout is a pipe that the child will write to  
  6.        2 => array("pipe", "w") // stderr is a pipe that the child will read from  
  7.     );
  8.     flush();
  9.     $process = proc_open($cmd, $descriptorspec, $pipes, './', array());
  10.     if (is_resource($process)) {
  11.         while ($s = fgets($pipes[1])) {
  12.             //Do whatever
  13.             flush();
  14.         }
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment