note 42794 added to function.eregi
| From: | aleczapka | Date: | Sat, 29 May 2004 18:41:10 +0000 |
| Subject: | note 42794 added to function.eregi | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-70281@lists.php.net to get a copy of this message | ||
This function is _not_ identical to ereg as it seems.
I am running PHP 4.3.6 and trying to do simple thing.
<?php
if (ereg("^SELECT|SHOW|EXPLAIN|DESCRIBE", $sql)) {
//do something - this works
}
?>
This works ok, but
<?php
if (eregi("^SELECT|SHOW|EXPLAIN|DESCRIBE", $sql)) {
//do something - this won't work
}
?>
Does not!
So far I can tell it is related to the lenght of the string I am checking. eregi works fine for some
(short) strings, but it fails to match the pattern with the long strings.
This is a dump of my string
string(11130) "UPDATE
test_data SET uid='1', gid='1',
perm='664',
data='Some long page body... (cut here)..."
The string is cutted for the sake of the example.
----
Manual Page -- http://www.php.net/manual/en/function.eregi.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42794
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42794&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42794&report=yes
Search -- http://master.php.net/manage/user-notes.php