note 55048 added to function.str-ireplace

From: Date: Sat, 23 Jul 2005 15:34:38 +0000
Subject: note 55048 added to function.str-ireplace
Groups: php.notes 
Request: Send a blank email to php-notes+get-92343@lists.php.net to get a copy of this message
Whatch out on solution provided bu (kosta dot krauth at zg dot htnet dot hr). I've used it in my spammersblog at http://www.spammersblog.com . It has nasty bug in this line: while($Pos = strpos(strtolower($Haystack), $Needle, $i)) As we can see if Needle occurs at position 0 Haystack won't be checked at all. You should change this line into: while(($Pos = strpos(strtolower($Haystack), $Needle, $i)) !== FALSE) to make this function work proper. ---- Manual Page -- http://www.php.net/manual/en/function.str-ireplace.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+55048 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55048&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55048&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55048&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55048&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55048&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55048&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+55048&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#92343) next »