you might be better with http://phpjs.org/functions/addslashes:303