note 52327 added to function.str-ireplace

From: Date: Wed, 27 Apr 2005 22:42:57 +0000
Subject: note 52327 added to function.str-ireplace
Groups: php.notes 
Request: Send a blank email to php-notes+get-88665@lists.php.net to get a copy of this message
For Kosta's str_Ireplace function, I think you'll want to lowercase the needle as well as the haystack in the strpos function, ie: while ($pos = strpos(strtolower($haystack), $strtolower($needle), $i)) { ... } In its current form, it only works as expected if the needle is always provided lowercase. ---- Manual Page -- http://www.php.net/manual/en/function.str-ireplace.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+52327 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52327&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52327&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52327&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52327&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52327&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+52327&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#88665) next »