This is a discussion on "return_values PHP" within the PHP Forum section. This forum, and the thread "return_values PHP are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
return_values PHP
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
return_values PHP
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? |
|
|
|
|||
|
Re: return_values PHP
I did a quick google on it and here is what i found:
"I believe "1" to be indicative of an error, where "0" is, ALL IS OK. An example being with the intended function of exec. string exec (string command [, string array [, int return_var]]) You need to test return_val which will be the error condition. ex. exec("touch hi",,$err); if ($err) die("Could not create file");" dont know if it will be of any help to you though. |
![]() |
| Tags |
| return_values, php |
| Thread Tools | |
|
|