replacing text with uper and lower case
Posted: Tue Jul 29, 2008 10:42 am
Is there a function in php to replace text with a variable but have it mainting the case of the text being replaced? For example,
$input1 = some word
Then I want to go out and find all occurances of "some other word" and "Some Other Word" and replace them with input1, but maintain their original case so they would become "some word" and "Some Word". Hopefully, my explaination makes sense. Is there an easy way to do this?
Thanks in advance for any help. I just started teaching myself php on the side about 2 weeks ago, so I don't even know what to look for.
$input1 = some word
Then I want to go out and find all occurances of "some other word" and "Some Other Word" and replace them with input1, but maintain their original case so they would become "some word" and "Some Word". Hopefully, my explaination makes sense. Is there an easy way to do this?
Thanks in advance for any help. I just started teaching myself php on the side about 2 weeks ago, so I don't even know what to look for.