note 63886 added to function.eregi

From: Date: Mon, 03 Apr 2006 07:44:58 +0000
Subject: note 63886 added to function.eregi
Groups: php.notes 
Request: Send a blank email to php-notes+get-107209@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: 194.246.101.61 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.eregi.php Edit -- http://master.php.net/note/edit/63886 Del: integrated -- http://master.php.net/note/delete/63886/integrated Del: useless -- http://master.php.net/note/delete/63886/useless Del: bad code -- http://master.php.net/note/delete/63886/bad+code Del: spam -- http://master.php.net/note/delete/63886/spam Del: non-english -- http://master.php.net/note/delete/63886/non-english Del: in docs -- http://master.php.net/note/delete/63886/in+docs Del: other reasons-- http://master.php.net/note/delete/63886 Reject -- http://master.php.net/note/reject/63886 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#107209) next »