PHP删除数组中某个元素后,键标如何重新排序?
例如:Array([0]=>0[1]=>1[2]=>2[3]=>3[4]=>4[5]=>5)键值和键标一一对应。如果删除键值4,变为Array([0]=>0[1]=>1[...
例如:Array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [4] => 4 [5] => 5)键值和键标一一对应。如果删除键值4,变为
Array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [5] => 5);
如何得到Array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [4] => 4 [4] => 5);达到目的:改变删除数据后面的键标? 展开
Array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [5] => 5);
如何得到Array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [4] => 4 [4] => 5);达到目的:改变删除数据后面的键标? 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询