Jump to content

str_replace bug


drisate

Recommended Posts

Hey guys. I am currently making a small seach script and i wanted to make the seach string red in the result so i did this:

 

$ebook[name]=str_replace($_GET[q], "<font color='#FF0000'>$_GET[q]</font>", $ebook[name]);

$ebook[description]=str_replace($_GET[q], "<font color='#FF0000'>$_GET[q]</font>", $ebook[description]);

 

Works great. If you seach "hello" is will replace hello by a red hello.

 

But i am experiencing a small bug with it ... if you type "Hello" and in the string theres "hello" it's not gona put it red because the cap makes it diffrent ... how can i solve that?

Link to comment
https://forums.phpfreaks.com/topic/122812-str_replace-bug/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.