我在变量 $db_array 下有一个数组。如何将 [code] 字段放入新数组变量 $code 中,将 [subject] 字段放入新数组变量 $subject 中?
Array ( [id] => 208 [code] => ABCDEF [subject] => A )
Array ( [id] => 324 [code] => GHIJKL [subject] => B )
Array ( [id] => 382 [code] => MNOPQR [subject] => C )
以及如何 foreach 循环这两个新数组变量?就像是
foreach($code as $i && $subject as $k){
if($i == ABCDEF && $k == A){
echo "yes";
}
else{ echo "no"; }
}