note 63885 deleted from function.quotemeta by bjori
| From: | bjori@php.net | Date: | Mon, 03 Apr 2006 11:48:10 +0000 |
| Subject: | note 63885 deleted from function.quotemeta by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-107223@lists.php.net to get a copy of this message | ||
Note Submitter: karlzzzz at yahoo dot com
----
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.