Your Ad Here

Posted By

kendsnyder on 07/16/11


Tagged

exec popen pclose


Versions (?)

Fork a process in PHP


 / Published in: PHP
 

  1. function forkExec($command) {
  2. if(stripos(PHP_OS, 'win') !== false) {
  3. $command = "start /b $command";
  4. }
  5. else {
  6. $command .= ' > /dev/null &';
  7. }
  8. return pclose(popen($command, 'r'));
  9. }

Report this snippet  

You need to login to post a comment.