首页 > php教程 > php手册 > 正文

php 多维数组

WBOY
发布: 2016-06-06 19:45:08
原创
978 人浏览过

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

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门推荐
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板