当前位置:Gxlcms > PHP教程 > php的magic_quotes_gpc动态关闭无效的解决方法

php的magic_quotes_gpc动态关闭无效的解决方法

时间:2021-07-01 10:21:17 帮助过:16人阅读

  1. if (ini_get('magic_quotes_gpc')) {
  2. function stripslashesRecursive(array $array)
  3. {
  4. foreach ($array as $k => $v) {
  5. if (is_string($v)) {
  6. $array[$k] = stripslashes($v);
  7. } else if (is_array($v)) {
  8. $array[$k] = stripslashesRecursive($v);
  9. }
  10. }
  11. return $array;
  12. }
  13. $_GET = stripslashesRecursive($_GET);
  14. $_POST = stripslashesRecursive($_POST);
  15. }
  16. ?>

人气教程排行