使用 ajax get 方法传递变量。我使用 escape() 函数对字符串进行转义。
在 php 中,我接收值并将其插入数据库。
如何对字符串进行转义?
例如,对于:
balaji's
我明白了
balaji%27s.
最佳答案
您可以使用此函数代替 urldecode()
function utf8_urldecode($str) {
return html_entity_decode(preg_replace("/%u([0-9a-f]{3,4})/i", "&#x\\1;", urldecode($str)), null, 'UTF-8');
}
关于php - 如何取消转义字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5893965/