Home  >  Article  >  php教程  >  php 多维数组

php 多维数组

WBOY
WBOYOriginal
2016-06-06 19:45:08980browse

$all = array(); $a = array("Horse" = "0", "Dog" = "1", "Cat" = "2"); $b = array("Horse" = "A", "Dog" = "B", "Cat" = "C"); $c = array("Horse" = "A1", "Dog" = "B2", "Cat" = "C3"); $all["123456"]["511"] = $a; $all["123456"]["523"] = $b; $all[

$all = array();

$a = array("Horse" => "0", "Dog" => "1", "Cat" => "2");
$b = array("Horse" => "A", "Dog" => "B", "Cat" => "C");
$c = array("Horse" => "A1", "Dog" => "B2", "Cat" => "C3");
$all["123456"]["511"] = $a;
$all["123456"]["523"] = $b;
$all["123456"]["607"] = $c;

var_dump($all);

输入:

php 多维数组

请教怎样通过一个函数实现根据一个“键名”获取到同级的前一个数组的内容,比如: 输入键名“523” 后返回 键名“511” 的内容。

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