我有一個像下面多維數組發現兩個日期
array(
"hgfh" => array("s" => "2011-11-28T07:00-04:00", "e" => "2011-11-29T06:59-04:00"),
"hgfh" => array("s" => "2011-11-29T07:00-04:00", "e" => "2011-11-30T06:59-04:00"),
"hgfh" => array("s" => "2011-11-30T07:00-04:00", "e" => "2011-12-01T06:59-04:00"),
"hgfh" => array("s" => "2011-12-01T07:00-04:00", "e" => "2011-12-02T06:59-04:00"),
"hgf" => array("s" => "2011-12-02T07:00-04:00", "e" => "2011-12-05T06:59-04:00"),
"sog" => array("s" => "2011-12-05T07:00-04:00", "e" => "2011-12-06T06:59-04:00"),
"gfd" => array("s" => "2011-12-06T07:00-04:00", "e" => "2011-12-07T06:59-04:00"),
"gfd" => array("s" => "2011-12-07T07:00-04:00", "e" => "2011-12-08T06:59-04:00"),
"bob" => array("s" => "2011-12-08T07:00-04:00", "e" => "2011-12-09T06:59-04:00"),
"tree" => array("s" => "2011-12-09T07:00-04:00", "e" => "2011-12-11T23:00-04:00"),
);
例如,一個數組中,我需要確定當前date("c");
是數組中的"s"
和"e"
之間再拿到鍵。所以它會說今天是2011-11-30T09:50-04:00
,並確定關鍵是hgfh
有沒有快速和骯髒的方法來做到這一點?我對性能有點擔心,所以如果有一種更好的性能方法,我會很感激。
你有相同的索引'hgfh' 4次,這是一個錯誤的複製和粘貼? –
這是垃圾數據哈哈 – Steven