something wrong with replace string? [closed]

Let’s say you have this as you retrieved text (whether from html or any other form):

$str="THE HTML FILE:

Test

Test1

Test2

Test3";

this function will remove “Test2” from the string:

$newstr=str_replace("Test2","",$str);

for more information of the function take a look at here

Just one more thing, if you have <br> after each line in your example, you need to do the same for those too.

Leave a Comment