Php? Calendar each event corresponds to a start date and end date
Example: 2015-10-05 2015-11-03 XXX activity
The XXX activity will be displayed when you move the cursor over this period.
The following are my ideas,
Will it be too troublesome?
Reply to discussion (solution)
You can continue to study
You can continue to study
The idea is correct!
But some tips can be used for implementation.
$ D = '2017-11-01 '; // you can obtain $ a = array ('event _ start_date' => '2017 ', 'event _ end_date '=> '2017-11-15'), array ('event _ start_date '=> '2017-11-17 ', 'event _ end_date '=> '2017-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 );Returns an array.
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] => )