Home >Backend Development >PHP Tutorial >PHP多维数组****键名****重命名

PHP多维数组****键名****重命名

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-23 14:15:441175browse

PHP Color

$a = array(127 => array(0 => dog,1 => cat,2 => duck),854 => array(0 => fish,1 => monkey,2=>bear))




请将“127”,“854”重命名成“0”,“1”。

不知道是不是有办法,谢谢各位!!!

回复讨论(解决方案)

$a = array_values($a);
print_r($a); //看一下

$a = array_values($a);
print_r($a); //看一下

非常感谢您帮助我,试了一下,可以用。谢谢!!!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn