#33076 [Opn->Fbk]: str_ireplace not working with 1 character as search

From: Date: Fri, 20 May 2005 09:35:11 +0000
Subject: #33076 [Opn->Fbk]: str_ireplace not working with 1 character as search
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-79245@lists.php.net to get a copy of this message
ID: 33076 Updated by: sniper@php.net Reported By: sebastianvasile at yahoo dot com -Status: Open +Status: Feedback Bug Type: Strings related Operating System: Linux 2.6.3 PHP Version: 5.0.4 New Comment: Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip I can not reproduce this. Previous Comments: ------------------------------------------------------------------------ [2005-05-20 11:32:57] sebastianvasile at yahoo dot com Description: ------------ str_ireplace is causing a "Page cannot be displayed" when I pass a single letter as $search. Reproduce code: --------------- $value = str_ireplace($keyword, "<font color=\"red\">".strtoupper($keyword)."</font>", $value); I want to use this code for highlighting $keyword found in $value. $value is a large string. It works fine if $keyword has more than one caracter. It works fine if I use str_replace. If I pass only one character I get a Page cannot be displayed Expected result: ---------------- String with characters replaced. Actual result: -------------- The page cannot be displayed, in IE 6.0.2800.1106, on Win Me ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33076&edit=1

« previous php.bugs (#79245) next »