Re: Suggestion for "IN()"

From: Date: Fri, 01 Oct 2004 13:12:43 +0000
Subject: Re: Suggestion for "IN()"
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-198406@lists.php.net to get a copy of this message
Christophe Chisogne wrote:
Daniel Schierbeck wrote:
    return ($var > $min && $var < $max) ? TRUE : FALSE;
(...)
    return in_array($needle, $haystack) ? TRUE : FALSE;
You can return booleans without comparing them to true/false:
    return $var > $min && $var < $max;
    return in_array($needle, $haystack);
Christophe
Thanks, nicely spotted there. Daniel

« previous php.general (#198406) next »