发布于 2年前

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

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

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

解决方法

解决方法其实也很简单,只需要将:

while (list($key, $val) = each($array)) { 

}

改为

foreach ($array as $key => $val) {

}
PHP
©2020 edoou.com   京ICP备16001874号-3