PHP 使用stripcslashes消除POST中HTML代码被增加的反斜杠

Categories: PHP; Tagged with: ; @ September 8th, 2010 20:57

某天, 需要从Post一部分HTML代码到php中, 但发现收到数据后引号一类的字符都被增加了转义字符, 导致HTML无法正常显示.

解决方法: 使用$body = stripcslashes($_REQUEST[‘body’]);

另外, 亦可通过设置php.ini中magic_quotes_gpc为off解决(未验证).
参考: http://topic.csdn.net/u/20090519/12/ed7db18d-4cc2-4dad-8a4d-f7799d6deda1.html



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.