This article mainly introduces the method of changing the array key value in PHP. It has a certain reference value. Now I share it with you. Friends in need can refer to it
$keys = range(0, count($infos)-1);//重新生成指定范围的数组 $arr = array_combine($keys, array_values($infos));//将键和值重新组合,形成新数组
The above is the detailed content of How to change array key value in PHP. For more information, please follow other related articles on the PHP Chinese website!