各イベントは開始日と終了日に対応します
例: 2015-10-05 2015-11-03 XXX アクティビティ
この日付にマウスを移動すると、XXX アクティビティが表示されます
以下は私のアイデア、
面倒ですか?
勉強を続けてもいいです
勉強します
アイデアは正しいです!
ただし、
$d = '2015-11-01';//查表得到$a = array( array('event_start_date' => '2015-11-07', 'event_end_date' => '2015-11-15'), array('event_start_date' => '2015-11-17', 'event_end_date' => '2015-11-20'),);$t = array_fill(1, date('t', strtotime($d)), '');foreach($a as $v) { $s = date('d', strtotime($v['event_start_date'])); $e = date('d', strtotime($v['event_end_date'])); $t = array_fill( $s, $e - $s + 1, 'event') + $t;}ksort($t);print_r($t);
Array( [1] => [2] => [3] => [4] => [5] => [6] => [7] => event [8] => event [9] => event [10] => event [11] => event [12] => event [13] => event [14] => event [15] => event [16] => [17] => event [18] => event [19] => event [20] => event [21] => [22] => [23] => [24] => [25] => [26] => [27] => [28] => [29] => [30] => )