Home > php教程 > php手册 > body text

php 多维数组

WBOY
Release: 2016-06-06 19:45:08
Original
979 people have browsed it

$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” 的内容。

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template