php7.2 废弃each方法

each方法替换为

function fun_adm_each(&$array){
   $res = array();
   $key = key($array);
   if($key !== null){
       next($array); 
       $res[1] = $res['value'] = $array[$key];
       $res[0] = $res['key'] = $key;
   }else{
       $res = false;
   }
   return $res;
}

 

你可能感兴趣的:(php7.2 废弃each方法)