问题很简单,就是数组怎么用?问题好像有点开放,就是怎么利用name来使用这些数组,或者有没有更好的方法或者相关文章介绍。附上我的神代码,小白在此谢过大神指点。抱拳抱拳再抱拳。
<?php
$shuzu[] = array(
"name" => "数字",
"slug" => "1",
"desc" => "2",
"id" => "3",
"type" => "4"
);
$shuzu[] = array(
"name" => "字母",
"slug" => "a",
"desc" => "b",
"id" => "c",
"type" => "d"
);
$shuzu[] = array(
"name" => "组合",
"slug" => "q5",
"desc" => "w6",
"id" => "e7",
"type" => "r8"
);
?>
5 回答
至尊宝的传说
TA贡献1789条经验 获得超10个赞
<?php
$Arr = [
'数字' => [
"slug" => "1",
"desc" => "2",
"id" => "3",
"type" => "4"
],
'字母' => [
"slug" => "a",
"desc" => "b",
"id" => "c",
"type" => "d"
],
'组合' => [
"slug" => "q5",
"desc" => "w6",
"id" => "e7",
"type" => "r8"
],
];
echo '<pre>';
var_dump($Arr['数字'], $Arr['字母'], $Arr['组合']);
楼上+1;同附链接PHP多维数组
修改了下,不知道楼主是否要实现这种?
根据Key去读对应的Value,数组的元素也可以是数组。
- 5 回答
- 0 关注
- 375 浏览
添加回答
举报
0/150
提交
取消