0
我必須篩選此數組才能看到未來的項目。 如何取消設置timeEnd過期的項目? 即,當我在17:00調用這個數組時,只剩下數組[2]。如何從多維數組中動態刪除鍵
陣列 ( [0] =>數組 ( [ID] => 3034 [日期] => 28-09-2016 [timeStart] => 08:30 [timeEnd] => 09 :30 [描述] => USER_A [locationId] => 1 [roomId] => 8 [relationId] => 104 )
[1] => Array
(
[id] => 2524
[date] => 28-09-2016
[timeStart] => 08:30
[timeEnd] => 12:00
[description] => User_B
[locationId] => 1
[roomId] => 5
[relationId] => 86
)
[2] => Array
(
[id] => 2533
[date] => 28-09-2016
[timeStart] => 09:00
[timeEnd] => 18:00
[description] => User_C
[locationId] => 1
[roomId] => 4
[relationId] => 31
)
)
循環遍歷數組通過date + timeEnd鍵創建時間戳,然後與當前時間進行比較,如果time> calculatetime未設置當前索引 – sietse85