I have a page that is written in HTML, I want to add a \ before every " and remove them before writing the code to开发者_JAVA百科 the page.
How can I perform this?
NOTE: I use file_get_contents("file.php");
to get the contents of the file to be added to the database.
Use mysql_real_escape_string on any value you want to write to your database.
use addslashes()
to add the \ and then stripslashes()
to remove them again.
edit: pass in as parameter your html code for each function
精彩评论