PHP版本6中 取消了get_magic_quotes_gpc()函數,首先這個函數的做用:是爲了防止sql注入,當該函數打開時將全部單引號,雙引號,sql
反斜線和空字符轉會自動轉爲含有反斜線的溢出字符。函數
PHP6取消magic_quotes機制,那麼就是默認轉義一些特殊字符來防止sql注入。get
當出現:Call to undefined function get_magic_quotes_gpc()時,就是這個緣由。io
能夠把源代碼改成:(PHP_VERSION >= 6 || !get_magic_quotes_gpc())或者(PHP_VERSION < 6 && get_magic_quotes_gpc())function