1

Possible Duplicate:
PHP: str_replace that only acts on the first match?

Now I used str_ireplace($find,$replace,$str) which replaces all the words which are present in $str. I want to replace first occurrence of a word in a string with the given string.

Community
  • 1
  • 1
vinoth
  • 471
  • 3
  • 7
  • 14
  • See: http://stackoverflow.com/questions/1252693/php-str-replace-that-only-acts-on-the-first-match – Jonathon Aug 13 '11 at 21:10
  • Just a thought, the difference being this question is looking for case insensitive, look at the i flag for preg_match and use the answer linked to by Jonny. – Jess Aug 13 '11 at 21:14

0 Answers0