0
我在谷歌看了幾個小時,但沒有找到我的問題上的任何信息。php數組時間過濾
$elements[] = array('time1' => $time1, 'time2' => $time2, 'string1' => $string1, 'string2' => $string2, 'string3' => $string3, 'string4' => $string4);
我得到數組元素$,這裏也有我寫出來與大家從HTML表格從網頁中網上看到了代碼行。但我找不到方法,如何能夠按時間過濾。
例如,我想使用時間間隔3小時,並從數組元素獲得未來3小時。
我試圖用
while($tmnw = date("H:i", strtotime('+3 hours')); $tmnw < $elements['time2']) {
echo information from array;
}
但他拋出錯誤:
[12-Nov-2016 20:35:03] PHP Notice: Trying to get property of non-object in filtering.php on line 15
[12-Nov-2016 20:35:03] PHP Notice: Undefined index: time2 in filtering.php on line 41
時間存儲陣列simple_dom:
$time1= date("H:i", strtotime($row->find('td',0)->plaintext));
$time2= date("H:i", strtotime($row->find('td',1)->plaintext));
謝謝!它的工作完美:) –