return_values PHP

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.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Oct 30th, 2005, 18:01
Up'n'Coming Member
Join Date: Sep 2005
Location: athens
Age: 25
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
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?
Reply With Quote

  #2 (permalink)  
Old Nov 1st, 2005, 10:57
Tim356's Avatar
Reputable Member
Join Date: Nov 2003
Location: Australia
Age: 25
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Tim356
Re: return_values PHP

I haven't used it before, but I have come across it while debugging someone elses code. I believe it's used more for interacting with external programs - as in, you run an external program using php and the return value that that external program outputs is returned to your script in the return_var. That's the best I can come up with - as I said, I've only come across it while looking through someone elses code.

In what context are you using it, studying it?
Reply With Quote
  #3 (permalink)  
Old Nov 1st, 2005, 14:06
Junior Member
Join Date: Aug 2005
Location: Colchester
Age: 28
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Reply With Quote
Reply

Tags
return_values, php

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 21:30.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43