Case Insenitive string replacing - php 4
Posted: Tue Aug 15, 2006 11:32 am
Okay, this is a pretty basic question. What is everyone's opinion on doing case insentive string replacements in php 4. I use to user eregi_replace(), but this has started to cause problems with patterns being inputted, etc. I would love to use str_ireplace(), but since it's php 5 only I can't.
This is an example of what I mean:
This is an example of what I mean:
Code: Select all
$find = "<title>";
$replaceWith = "<title>Yeah";
$search = "<TITLE>";
$end = eregi_replace($find, $replaceWith, $search); //works
$end = str_replace($find,$replaceWidth,$search); //Doesn't work