i have a long string that can hold all these values at the same time:
hello<!>how are you? <!>I am fine<!> What is up? <!> Nothing!
I need to find all these posibilities:
' <!> '
' <!>'
'<!> '
'<!>'
And replace them with “\n”
Can that be achieved with str_replace in php?
If you only have those 4 possibilities, yes, then you can do that with
str_replace.You can either add special cases for each of those, or use regular expressions: