我有一个名为$ all的变量,当我执行print_r($ all)时,它打印出来:
Array ( [2016] => Array ( [target] => 150 [tv1] => 32 [radio1] => 8 [tv2] => 19 [radio2] => 50 [tv3] => 30 [radio3] => 11 [tv4] => 10 [radio4] => 33 [total_actual] => 193 [variance] => 43 [variance_reason] => Reason one ) [2017] => Array ( [target] => 120 [tv1] => 34 [radio1] => 21 [tv2] => 31 [radio2] => 44 [tv3] => 12 [radio3] => 25 [tv4] => 20 [radio4] => 19 [total_actual] => 206 [variance] => 86 [variance_reason] => ) )
如何只提取2016
和2017
(数组的键)?谢谢!
答案 0 :(得分:1)
print($all['2016']);
和
print($all['2017']);
答案 1 :(得分:0)