我得到了这个数组:
Array
(
[0] => Array
(
[MONTH] => April
[logs-count] => 14
[log_type] => 0
)
[1] => Array
(
[MONTH] => August
[logs-count] => 942
[log_type] => 0
)
[2] => Array
(
[MONTH] => July
[logs-count] => 132
[log_type] => 0
)
[3] => Array
(
[MONTH] => June
[logs-count] => 114
[log_type] => 0
)
[4] => Array
(
[MONTH] => March
[logs-count] => 424
[log_type] => 0
)
[5] => Array
(
[MONTH] => May
[logs-count] => 79
[log_type] => 0
)
[6] => Array
(
[MONTH] => November
[logs-count] => 269
[log_type] => 0
)
[7] => Array
(
[MONTH] => October
[logs-count] => 4447
[log_type] => 0
)
[8] => Array
(
[MONTH] => October
[logs-count] => 3
[log_type] => 1
)
[9] => Array
(
[MONTH] => September
[logs-count] => 1003
[log_type] => 0
)
)
我想将此值放入 2 个数组,其中:对于每个月if log_type = 0
,转到 1 个数组if log_type = 1
,然后转到 2 个数组,但是如果有来自 f 的日志(例如 11 月并且他的 log_type 为 0,则转到 1 个数组,但转到第二个数组0)
所以在最后它应该是这样的,例如上面的:
1 个数组
Array
(
[0] => 14
[1] => 942
[2] => 132
[3] => 114
[4] => 424
[5] => 79
[6] => 272
[7] => 4447
[8] => 1003
)
2 阵列
Array
(
[0] => 0
[1] => 0
[2] => 0
[3] => 0
[4] => 0
[5] => 0
[6] => 0
[7] => 3
[8] => 0
)