Page 1 of 1
stripping quotes from text
Posted: Fri Aug 15, 2003 3:06 pm
by macewan
Code: Select all
$text = preg_replace("/"/","“",$text);
this was used previously on text being put in a database (mysql).
What I would like to do is strip all left double quotation marks from text being retrieved from the database. The reason for this is that I have a function to change the standard quotes into left and right double quotation marks.
Posted: Fri Aug 15, 2003 4:08 pm
by m3rajk
is htmlentities or htmlspecialchar of any use to you? (not quite sure why you'd leave it in when inserting.. don't you need to addslashes?)
Posted: Fri Aug 15, 2003 6:48 pm
by macewan
that's sorta the idea but it doesn't work quite right.
Posted: Sat Aug 16, 2003 2:14 pm
by m3rajk
then why not change it to $text=addslashes(htmlentities($text, NO_ENTQUOTES));