Should PHP function ever return null?
| From: | Tyson Lloyd Thwaites | Date: | Mon, 04 Sep 2000 01:49:36 +0000 |
| Subject: | Should PHP function ever return null? | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-2603@lists.php.net to get a copy of this message | ||
Hi,
$test = eregi("HI", "HI THERE");
if ($test) {
echo "true:" . $test . ":";
} else {
echo "false:" . $test . ":";
}
The first case returns "true:1:" while the second branch replies "false::"
Shouldn't the second one be "false:0:"?
This could explain why sometimes a function returns the opposite of what I
expect.
For example:
$select = eregi("SELECT", $this->qry);
if ($select) ...
I have to put a "!" in front of eregi to make this work properly.
Any ideas?
Thanks
Regards,
Tyson Lloyd Thwaites
IT&e Ltd