php 多维数组
程序员文章站
2022-06-04 13:17:49
...
$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);
输入:
请教怎样通过一个函数实现根据一个“键名”获取到同级的前一个数组的内容,比如: 输入键名“523” 后返回 键名“511” 的内容。
上一篇: 浅谈PHP与Java之Web开发整合技术
下一篇: iOS开发返回指定控制器