I've lost the plot a bit this afternoon. Now surely this is simple - but I'm just lost.
Lets say:
$subject = 'Holy purple FOO phpBoy!';
My search string is:
$search = 'foo';
My replace string is (not really relevent but for the sake of the example):
$replace = 'bar';
Now, I want a regex where 'foo' will match 'FOO' and thus 'FOO' will be replaced by 'bar'.
I thought:
eregi_replace($search, $replace, $subject)
would do this for me.
This is user submitted text I'm massaging, and I don't want to change their capitalization. If they think it r0x0rs to spell foo as fOO - that's their perogative.
But looks like I'm all out of bar on this one![]()





Bookmarks