凡科这样的建站网站,漯河网站推广公司,做音频的网站,山西建设工程执业注册中心网站今天有个thinkphp5.0版本的项目切换到php7.2版本#xff0c;有个页面一直报错#xff0c;打开调试代码。发现错误提示“The each() function is deprecated. This message will be suppressed on further calls”。说明php不建议继续使用each函数了#xff0c;那如何修改代码…今天有个thinkphp5.0版本的项目切换到php7.2版本有个页面一直报错打开调试代码。发现错误提示“The each() function is deprecated. This message will be suppressed on further calls”。说明php不建议继续使用each函数了那如何修改代码了下面介绍两种方法1、改成 key()、current()函数来组装$arr[namephper163,year2020];list($a,$b) [key($arr),current($arr)];var_dump($a,$b);//string(4) name string(8) phper1632、使用foreach语法来实现$arr[namephper163,year2020];foreach($arr as $key$val){var_dump([$key,$val]);}//array(2) { [0] string(4) name [1] string(8) phper163 } array(2) { [0] string(4) year [1] int(2020) }