反向mysql_real_escape_string [英] reverse mysql_real_escape_string
问题描述
我有一条很大的数据,可能包含引号和双引号.
I have a piece of data that is large and will probably contain quotes and double quotes.
我正在使用mysql_real_escape_string()
安全地存储它.
I'm using mysql_real_escape_string()
to store it safely.
当我拉出它查看时,所有引号都被转义了.我尝试使用str_replace
删除所有引号,但这将\r\n
转换为rn
. :(
When I pull it out to look at it, all the quotes are escaped. I tried using str_replace
to just get rid of all the quotes, but that turns \r\n
's into rn
. :(
如何反转它,以便数据以输入的方式返回?
How can I reverse it so the data comes back out the way it went in?
推荐答案
您使用魔术引号吗?
注意:如果启用了magic_quotes_gpc, 首先将stripslashes()应用于 数据.对数据使用此函数[mysql_real_escape_string] 已经逃脱的遗嘱 将数据转义两次.
Note: If magic_quotes_gpc is enabled, first apply stripslashes() to the data. Using this function [mysql_real_escape_string] on data which has already been escaped will escape the data twice.
这篇关于反向mysql_real_escape_string的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!