Home > Backend Development > PHP Tutorial > 已知数组中每个值长度相同,怎么增加一个key键呢

已知数组中每个值长度相同,怎么增加一个key键呢

WBOY
Release: 2016-06-13 11:40:09
Original
856 people have browsed it

已知数组中每个值长度相同,如何增加一个key键呢?
array
(
 x=> array(0,01,02,...0x),
 y=> array(0,11,12,...1x),
 ...
 n=> array(0,n1,n2,...nx),
)
已知该数组中每个值的长度都是相同的,如:array[x]和array[y]两个数组的长度相等

我想再添加2个键array[a]和array[b],变成
array
(
 x=> array(0,01,02,...0x),
 y=> array(0,11,12,...1x),
 ...
 n=> array(0,n1,n2,...nx),

 a=> array(a,a,a,...b),
 b=> array(b,b,b,...b),
)
有什么好的方法吗

(我现在只想到 先获取到所有的keys,然后再获取第1个key的值长度。然后再填充array[a]和array[b])

Related labels:
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