如果tran2
tran3
,tran4
,name = transport_method
例如: -
Array (
[0] => Array ( [name] => transport_method[] [value] => tran2 )
[1] => Array ( [name] => transport_method[] [value] => tran3 )
[2] => Array ( [name] => transport_method[] [value] => tran4 )
)
答案 0 :(得分:1)
使用if()
foreach($array as $arr){
if($arr['name'] =='transport_method[]'){
echo $arr['value'];
}
}
请检查所有三项输出: - https://eval.in/939902和https://eval.in/939909以及https://eval.in/939911
答案 1 :(得分:0)
<?php
foreach($yourvariable as $data) {
if($data['name'] == "transport_method"){
echo $data['value'];
}
}