分类目录报错解决方法

来源:重庆分类目录  浏览:639次  时间:2020-01-08

分类目录在使用PHP5.5、PHP5.6时出现大量的警告报错:PHP Deprecated:  preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/source/module/rewrite.php on line 30。即网站程序在source/module/rewrite.php 第30项,报错语句:return preg_replace($search, $replace, $content);提示改为preg_replace_callback().经分析分别改为以下即可以解决!

原第一个:$search = array(
"/href\=\"(\.*\/*)\?mod\=(index|webdir|weblink|article|category|update|archives|top|feedback|link)?\"/e",
注意/e 不要。

第二 $replace = array(
"rewrite_module('\\2')",

最后改


run  preg_replace_callback($search, function ($matches) {return rewrite_other($matches[2]);}, $content);