Posted By

traeregan on 07/22/09


Tagged

output exec


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

d0ri0


Capture exec() output


 / Published in: PHP
 

URL: http://xantorohara.blogspot.com/2008/09/php-exec-output.html

  1. <?php
  2.  
  3. function execOutput($command) {
  4. $output = array($command);
  5. exec($command.' 2>&1', $output);
  6. return implode("\n", $output);
  7. }
  8.  
  9. echo execOutput('help');
  10. ?>

Report this snippet  

You need to login to post a comment.