首页 > Web开发 > 详细

php报错The each() function is deprecated. This message will be suppressed on furthe

时间:2021-05-04 13:52:58      阅读:32      评论:0      收藏:0      [点我收藏+]

技术分享图片

最近调用网站自动加链接时发现的一个问题,出现了这个错误

翻译一下:不推荐使用each()函数。 此消息将在以后不再显示

原因:php7.2以上废除了each()方法,项目中用到的地方会出现以下报错

The each() function is deprecated. This message will be suppressed on further calls

解决办法,很简单把以下代码

while (list($k,$l) = each($lines)){}

  技术分享图片

更正为:

foreach ($lines as $k => $l){}

  技术分享图片

技术分享图片

原文链接

php报错The each() function is deprecated. This message will be suppressed on furthe

原文:https://www.cnblogs.com/qaqbuyan/p/14728918.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!