my text:
bob have message123 and alice has message
i want:
bob have newmessage and alice has newmessage
My current code is:
$fullText= str_replace("message123", "newmessage", $fulltext);
$fullText= str_replace("message", "newmessage", $fulltext);
but it becomes:
bob have newnewmessage and alice has newmessage
- 'new' is repeated because str_replace(); search whole text and find replace again.
- is it possible not to replace the text which is already replaced.
str_replaceex:str_replace( array( "message", "newmessage1" ), "newmessage", $fullText );