ecshop高php版本,ecshop php高版本报错解决

本文档详细记录了如何解决ECSHOP模板引擎在PHP环境中出现的弃用警告和严格标准错误。主要涉及preg_replace()函数的'emodifier'替换为preg_replace_callback(),以及相关代码结构调整。
摘要由CSDN通过智能技术生成

Deprecated:

preg_replace(): The /e modifier is deprecated, use

preg_replace_callback instead in

E:\phpStudy\WWW\ecshop\includes\cls_template.php on line

300

将cls_template.php

return

preg_replace("/{([^\}\{\n]*)}/e", "\$this->select('\\1');",

$source);

替换

return

preg_replace_callback("/{([^\}\{\n]*)}/", function($r) { return

$this->select($r[1]); }, $source);

Strict Standards: Only

variables should be passed by reference in

E:\phpStudy\WWW\ecshop\includes\cls_template.php on line

423

将cls_template.php

$tag_sel =

array_shift(explode(' ', $tag));

替换

$tag_tmp = (explode('

', $tag));

$tag_sel =

array_shift($tag_tmp);

Deprecated:

preg_replace(): The /e modifier is deprecated, use

preg_replace_callback instead in

E:\phpStudy\WWW\ecshop\includes\cls_template.php on line

1074

将cls_template.php

$pattern

= '/.*? /se';

$replacement =

"'{include file='.strtolower('\\1'). '}'";

$source

=

preg_replace($pattern, $replacement, $source);

替换

$pattern = '/ .*?

/s';

$source =

preg_replace_callback($pattern, function($r){return '{include

file='.strtolower($r[1]). '}';}, $source);

Deprecated:

preg_replace(): The /e modifier is deprecated, use

preg_replace_callback instead in

E:\phpStudy\WWW\ecshop\includes\cls_template.php on line

496

将cls_template.php

$out = "

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
>