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

2021/5/4 12:27:19

本文主要是介绍php报错The each() function is deprecated. This message will be suppressed on furthe,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

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

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

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

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

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

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

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

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

更正为:

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

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

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

原文链接



这篇关于php报错The each() function is deprecated. This message will be suppressed on furthe的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程