Capture exec() output


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your 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. ?>

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.