Forum Moderators: coopster

Message Too Old, No Replies

return_values PHP

more infos?

         

ktsirig

7:01 pm on Oct 30, 2005 (gmt 0)

10+ Year Member



I have trouble understanding the meaning of the return_var in PHP.
I read that it is used in order to inform us if a PHP command has been executed.
I use system commands in PHP (like 'system', 'shell_exec' etc) and I can't find anywhere a list of the return_vars.
I mean that 0 is for 'OK, the command was executed'.
What does 1 stand for?
I execute a system command , I don't get any result, and if I ask PHP for the return_var, it says '1'.
Where could I find more info as to what return_var=1 means?

ergophobe

10:11 pm on Oct 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I've never used it, but as I read the manual, it will returns the return code of the program or script that you call. Therefore, that value is not determined by PHP, but will be determined by the program or script that you call and whatever it returns.

So you'll need to look at the documentation for the program you're calling, or perhaps run it from the shell and see what it returns.

For example, the wait command suspends execution until a child process has exited. If you get a status code, it will be -1 on error, the process ID of the child process on success, or 0 if there is no child process and you called wait with the WHOHANG option.