Reputation: 51
Hi have the following code:
$ItemDescriptionNEW = str_replace('\"', '"',$ItemDescription);
$ItemDescriptionNEW = str_replace('\'', ''', $ItemDescriptionNEW);
When I execute it, only the single quote get replaced. I've been looking for the problem for the past hour and can't figure it out...
Upvotes: 1
Views: 47
Reputation: 59701
You have to remove the backslash where you use it with the double quote. Because you don't have to escape anything. So just use this:
$ItemDescriptionNEW = str_replace('"', '"',$ItemDescription);
Upvotes: 4