ecshop网站上传到服务器出现Deprecated: preg_replace()APP > 后花园 > ECShop

商城首页出现这样的错误

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in C:\websoft\web\hnxsjmy\shop\includes\cls_template.php on line 300

 

Strict Standards: Only variables should be passed by reference in C:\websoft\web\hnxsjmy\shop\includes\cls_template.php on line 418

解决:

return preg_replace("/{([^\}\{\n]*)}/e", "\$this->select('\\1');", $source);
//替换成如下
return preg_replace_callback("/{([^\}\{\n]*)}/", function($r) { return $this->select($r[1]); }, $source);

只要418行把这一句拆成两句就没有问题了  $tag_sel = array_shift(explode(' ', $tag)); 改成: $tag_arr = explode(' ', $tag);  $tag_sel = array_shift($tag_arr);

标签: none

首页期待您的来信!我们会认真诚实的对待每一位客户,有来信必将得到我们的回复!

谢谢您能首页!
嘿,我来帮您!