note 86956 modified in function.shell-exec by thiago
| From: | thiago@php.net | Date: | Wed, 12 Nov 2008 12:21:29 +0000 |
| Subject: | note 86956 modified in function.shell-exec by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-146420@lists.php.net to get a copy of this message | ||
if you want get exit status
<?php
$command = 'ls -lpas';
// Execute the shell command
$shellOutput = shell_exec($command.' > /dev/null; echo $?');
//return execute status;
echo trim($shellOutput);
?>
--was--
if you want get exit status
$command = 'ls -lpas';
// Execute the shell command
$shellOutput = shell_exec($command.' > /dev/null; echo $?');
//return execute status;
echo trim($shellOutput);
http://php.net/manual/en/function.shell-exec.php