mysql结果是以下数组
Array
(
[0] => Array
(
[customs_tariff_number] =>
)
[1] => Array
(
[customs_tariff_number] =>
)
[2] => Array
(
[customs_tariff_number] =>
)
[3] => Array
(
[customs_tariff_number] => 123456789
)
)
我的密钥[customs_tariff_number]不是空的我想做一个if条件来绘制像这样的桌子
if (in_array('customs_tariff_number', $array)) {
echo '<tr>rowname</tr>';
}
但它不起作用。
答案 0 :(得分:0)
您可以使用array_walk_recursive
function check($value, $key){
if($key === 'customs_tariff_number'){
echo '<tr>rowname</tr>';
}
}
array_walk_recursive($a, 'check');