求问在LAMP环境下的一段php代码的含义

来源:百度知道 编辑:UC知道 时间:2024/06/24 06:08:28
exec(/usr/X11R6/bin/astrolog -v -q 6 5 1908 02:06 -z0 0 -z 8 -zl 116E24 39N54,$retval)

请问这段代码的含义是什么?$retval的值是什么?
要把这段代码从lamp环境移到iis环境下,应该怎么做?

exec(/usr/X11R6/bin/astrolog -v -q 6 5 1908 02:06 -z0 0 -z 8 -zl 116E24 39N54,$retval)

是执行系统命令/usr/X11R6/bin/astrolog

想看$retval是什么,在他的上一行var_dump($retval);
会详细打印出来

exec函数的功能是执行外部命令,语法格式如下:

string exec ( string $command [, array &$output [, int &$return_var]] )

参数含义是:

command:The command that will be executed.

output:If the output argument is present, then the specified array will be filled with every line of output from the command. Trailing whitespace, such as \n, is not included in this array. Note that if the array already contains some elements, exec() will append to the end of the array. If you do not want the function to append elements, call unset() on the array before passing it to exec().

return_var:If the return_var argument is present along with the output argument, then the return status of the executed command will be written to this variable.

对于你的语句:
exec(/us