I'm entering news on my website through a form. While adding news or editing it, or get replaced with a br.
Now I still have an issue, when I write for example "I've" it will print out as I\'ve.
First question, is this caused due to mysql_real_escape_string(); ? Second question, how can I replace multiple matches with diffirent tags ?
Right now I have something like this:
$order = array("'", "\'");
$replace = "´";
$order = array("
", "
", "");
$replace = "<br />";
$string = $news;
$insert = str_replace($order, $replace, $string);
I'm almost sure this is not the correct way to do it because they are all assigned to the same variables,.. Could someone point me in the right direction please ?
Edit: Although this works, am I 'allowed' to code it like this ?
Edit: Thank you all for your answers, problem is fixed now ! :)