PHP code for compiling a common calendar to show the current day and current month

Source: Internet
Author: User
Compile a regular calendar and show the current day and current month? Phpdate_default_timezone_set (PRC); $ tdategetdate (); current time $ tmday $ tdate [mday]; today's day $ twday $ tdate [wday]; today's day of the week $ mon $ tdate [mon]; month $ year $ tdate [year]; this year

Compile a regular calendar and show the current day and current month? Php date_default_timezone_set ('prc'); $ tdate = getdate (); // current time $ tmday = $ tdate ['mday']; // today's day $ twday = $ tdate ['wday']; // today's day of the week $ mon = $ tdate ['mon']; // month $ year = $ tdate ['Year']; // this year

Compile a common calendar to show the current day and current month <无>
  "; $ Html. ="{$ Year}-{$ mon} month"; $ Html. ="SundayMondayTuesdayWednesdayThursdayFridaySaturday"; $ Html. =""; For ($ I = 0; $ I <($ swday % 7); $ I ++) $ html. =''; While ($ counts! = $ Days) {if ($ swday + $ counts) % 7 = 0) $ html. ="". (++ $ Counts ).''; Else if ($ swday + $ counts) % 7 = 6) $ html. ="". (++ $ Counts ).''; Else $ html. ="". (++ $ Counts ).'';} If ($ ewday! = 6) $ html. =''; $ Html. =''; Echo $ html;?>

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.