note 63885 added to function.quotemeta
| From: | karlzzzzatyahoodotcom at osu1 dot php dot net | Date: | Mon, 03 Apr 2006 07:43:13 +0000 |
| Subject: | note 63885 added to function.quotemeta | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-107208@lists.php.net to get a copy of this message | ||
I wanted a function that tells if any string is contained inside another one, with a case
insensitive comparison, but my web space provider is still using PHP4 so I don't have access to
function stripos, which is only available in PHP5.
So, I wrote this:
function theFirstStringIsInsideTheSecondOne($first,$second) {
return eregi(quotemeta($first), $second);
}
quotemeta is used here to prevent interpretation of special regex characters.
----
Server IP: 195.221.21.36
Probable Submitter: 84.7.13.193
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.quotemeta.php
Edit -- http://master.php.net/note/edit/63885
Del: integrated -- http://master.php.net/note/delete/63885/integrated
Del: useless -- http://master.php.net/note/delete/63885/useless
Del: bad code -- http://master.php.net/note/delete/63885/bad+code
Del: spam -- http://master.php.net/note/delete/63885/spam
Del: non-english -- http://master.php.net/note/delete/63885/non-english
Del: in docs -- http://master.php.net/note/delete/63885/in+docs
Del: other reasons-- http://master.php.net/note/delete/63885
Reject -- http://master.php.net/note/reject/63885
Search -- http://master.php.net/manage/user-notes.php