Possible Duplicate:
quick function to replace ' with \' in php
Is there a PHP function that only adds slashes to double quotes NOT single quotes
I have for example:
$one = 'put "returns" between "paragraphs"';
$two = '"linebreak" add 2 spaces "at end"';
How can I convert this for:
$one = 'put \"returns\" between \"paragraphs\"';
$two = '\"linebreak\" add 2 spaces \"at end\"';
The function you’re looking for is either
str_replaceoraddcslashes:Demo.