Jump to content

Quotation Marks


Steve Angelis

Recommended Posts

I am setting up a blog type of system for a website I am making and I have come across a much needed problem that must get fixed.

 

What is the easiest way to remove quotation marks from posts?  Probably when they are detected before entering into the database would be easiest, but any other ways would be good.

Link to comment
https://forums.phpfreaks.com/topic/91197-quotation-marks/
Share on other sites

mysql_real_escape_string

 

You'll need to have a database connection already open (though I assume that'll be the case as you mentioned you'll be inserting it into a database), and then you'll want to run:

 

$text = mysql_real_escape_string($text);

 

It will replace all special characters with escaped versions that store appropriately in MySQL.

Link to comment
https://forums.phpfreaks.com/topic/91197-quotation-marks/#findComment-467403
Share on other sites

Ok sounds good.

I am assuming that $text is just a variable representing all of the text I want checked out?

And is it possible to have it as such, because I am also using BBCode with it and line breaking:

 

nl2br(convert_bbcodes(mysql_real_escape_string($row['blog_message'])))

 

Would that work still?  I know the bbcode and line breaking does work with eachother already.

Link to comment
https://forums.phpfreaks.com/topic/91197-quotation-marks/#findComment-467404
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.