Strings related Bug #33076https://bugs.php.net/bug.php?id=33076
[Closed] str_ireplace not working with 1 character as searchFri, 20 May 2005 11:32:57 +0000Fri, 20 May 2005 16:24:27 +0000sebastianvasile@... [2005-05-20 11:32:57]Strings related Bug
Reported by sebastianvasile@...
Fri, 20 May 2005 11:32:57 +0000
PHP: 5.0.4, OS: Linux 2.6.3
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
]]>Fri, 20 May 2005 11:32:57 +0000https://bugs.php.net/bug.php?id=33076