Yes, you can return false. 

As for "true booleans", PHP doesn't really have a boolean type - it does
have a sense of "true" and "not true" though. You can return false (a
case-insensitive constant with the value 0) or true (whose value is
probably 1 but could really be anything other than 0 or the empty
string).

You can of course evaluate a true/false value as a regular condition...
if (someFunc()) {
  // do something if someFunc returns true
} else {
  // do something if someFunc returns false
}

..You get the idea.

--toby

Jonathan Sharp wrote:
> 
> How does php handle true and false? Do they act as true booleans?
> 
> Can I do?
> 
> function foo()
> {
>         return false;
> }
> 
> Thanks,
> -Jonathan
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to