note 63886 deleted from function.eregi by bjori

From: Date: Tue, 11 Apr 2006 16:49:38 +0000
Subject: note 63886 deleted from function.eregi by bjori
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-107780@lists.php.net to get a copy of this message
Note Submitter: karlzzzz a.t yahoo d.o.t 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.

« previous php.notes (#107780) next »