Replacing string with another

57 Views Asked by At

I'm trying to replace a String with another in php on my forum. I am using Invision Community engine, so I don't know if there is a point in asking a question here, but maybe someone will help me.

I have a notification, e.g. I'd like to replace string, lets say I'd like to change commented to reacted, but after using str_replace("commented", "reacted", $title); it doesn't do anything. I tried to use str_replace("a","b",$title); and this happened.

{{$title = $notification['data']['title'];}}
{{$title = str_replace("commented", "reacted", $title);}}
<span class='ipsDataItem_title ipsType_break'>{$title}</span>
0

There are 0 best solutions below