linux下也可以用system函数。记得我曾经写过一个发传真的代码里面就用到了system函数。因为它有返回值。可以判断是否成功。 <?php echo '<pre>';// Outputs all the result of shellcommand "ls", and returns // the last output line into $last_line. Stores the return value // of the shell command in $retval. $last_line = system('ls', $retval); $retval就是返回的值 // Printing additional info echo ' </pre> <hr />Last line of the output: ' . $last_line . ' <hr />Return value: ' . $retval; ?>
<?php
echo '<pre>';// Outputs all the result of shellcommand "ls", and returns
// the last output line into $last_line. Stores the return value
// of the shell command in $retval.
$last_line = system('ls', $retval);
$retval就是返回的值
// Printing additional info
echo '
</pre>
<hr />Last line of the output: ' . $last_line . '
<hr />Return value: ' . $retval;
?>
如果不能用
看该函数是否被禁用为了安全起见
请禁用