Skip to content Skip to sidebar Skip to footer

Something Wrong With Replace String?

Can anyone help me with this: It doesnt even delete the text... I Know i dont have it se

Solution 1:

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.

Post a Comment for "Something Wrong With Replace String?"