Skip to content

Instantly share code, notes, and snippets.

@savvot
Created June 5, 2014 13:53
Show Gist options
  • Save savvot/4c67efe1a8b2b92b8e14 to your computer and use it in GitHub Desktop.
Save savvot/4c67efe1a8b2b92b8e14 to your computer and use it in GitHub Desktop.
Run command\process from PHP in non blocking mode while dynamically reading its output
<?php
$fp = popen('ls 2>&1', 'r');
while(!feof($fp)) {
$str = fgets($fp);
}
pclose($fp);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment