Php? Calendar

Source: Internet
Author: User
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] => )

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.