反向mysql_real_escape_string [英] reverse mysql_real_escape_string

查看:90
本文介绍了反向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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆