Page 1 of 1

simple quest on return

Posted: Tue Apr 25, 2006 3:19 am
by boggle
I'm new to php and this question is probably stupidly simple. :oops:

If you have a bit of code that uses return, like :

Code: Select all

if (test=1)
return TRUE;
else
return FALSE;

How do you check what was returned?

Sorry if this question is a bit daft.

Posted: Tue Apr 25, 2006 3:24 am
by feyd
Return is only supposed to be used in functions/methods, so it would be what comes from them. You probably check the results of a function all the time without even knowing it:

Code: Select all

$return = isset($_GET['someVar']);
$return = include('someFile.php');
$return = str_replace('foo', 'bar', boofoo');

Posted: Tue Apr 25, 2006 4:26 am
by boggle
Thanks :)