php处理多维数组怎么获取里面值 50
array:2[0=>array:2["pid"=>"4""number"=>"1"]1=>array:2["pid"=>"5""number"=>"1"]]怎么循环获取...
array:2 [
0 => array:2 [
"pid" => "4"
"number" => "1"
]
1 => array:2 [
"pid" => "5"
"number" => "1"
]
]
怎么循环获取
pid和number
?*有这个array:2 是啥意思? 展开
0 => array:2 [
"pid" => "4"
"number" => "1"
]
1 => array:2 [
"pid" => "5"
"number" => "1"
]
]
怎么循环获取
pid和number
?*有这个array:2 是啥意思? 展开
2个回答
展开全部
2是指数组元素个数。
$a = array (
array(
"pid" => "4","number" => "1"
),
array(
"pid" => "5","number" => "1"
)
);
// 遍历多维数组
foreach($a as $b){
foreach($b as $key_pid => $value_number){
echo $key_pid;
echo $value_number;
}
}
$a = array (
array(
"pid" => "4","number" => "1"
),
array(
"pid" => "5","number" => "1"
)
);
// 遍历多维数组
foreach($a as $b){
foreach($b as $key_pid => $value_number){
echo $key_pid;
echo $value_number;
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询