wow, so over a year later... and i'm back checking out how to do a string replace to eliminate apostrophes in database entries.
this is what i've got: str_replace("'","'",'<br />',$_POST["solution"])
i need it to allow "'" and replace line breaks with "<br />"
thank you!
Live preview: parsing carriage returns
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
str_replace() takes three arguments. You're giving it four.
hmm... someone else told me to do this... and it sorta work:
i think something else may be wrong, because i'm still getting a syntax no-no, but, the echo appears correct.
Code: Select all
$search = array("'", "<br />");
$replace = array("'", "\n");
$solution = str_replace($search, $replace, $_POST["solution"]);