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

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

WBOY
Release: 2016-06-23 14:15:44
Original
1164 people have browsed it

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); //看一下

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

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template