PHP provides the date () function, which provides a variety of date processing functions. There are two types of data to be obtained: the first is the total number of days of the month, and the second is the number of days of the week in which the first day of the month is located. The number indicates 0 (indicating Sunday) to 6 (Saturday ).
The date () function can easily obtain the above data.
The Code is as follows:
Copy code
PHP Calender (Calendar) code, Phpcalender
= 2038) {$year = date (' Y '); }} else {if ($year Last year Last month Back to today Next month Next year {$year} year {$month} month
Monday
Tuesday
Wednesday
Thursday
Friday
Calendars written in php There are many calendars written in JavaScript on the internet. these calendars read local time and may be inaccurate. So I want to find a calendar written in php that can read the server time, but I still cannot find a suitable one, so I tried to write it myself.
Code
This article mainly introduces the PHP simple Calendar implementation method, involving PHP date and time related operations, very simple and practical, the need for friends can refer to the next
The results are as follows:
The specific code is as follows:
Summary: The above is the entire content of this article, I hope to be able to help you learn.
The example in this article describes the calendar program that PHP implements. Share to everyone for your reference. as follows:
The operation effect is as follows:
I hope this article will help you with your PHP program design.
PHP Trainer: Calendar (simple code and easy extension)
I wrote a calendar program, focusing only on functions and Implementation ideas, so the code and functions are simple, but it is easier to understand and expand.
The show () function is used to display the calendar. You can modify the show () function to display di
PHP generates the calendar code
/*
Function Written by Nelson Neoh @ 3/2004.
For those who wants to utilize this code, please do not remove this remark.
If you have done any enhancement to this code, please post the copy at http://www.dev-club.com PHP board. Thank you.
Function usage: calendar (Month, Year)
*/
Functi
This article mainly introduces the basic PHP implementation of the calendar display and real-time query function, interested in the friend's reference, I hope to be helpful to everyone.
The example of this article describes the implementation of the PHP calendar program, specifically as follows:
The results are as fo
When I was writing a file system, I took a fancy to a foreign HTML template... there was a calendar on it and I wanted to write it out in PHP...
The code is as follows:
$ Monthoneday = date ("Ym"). "01 ";
$ Oneweekday = date ("w", strtotime ($ monthoneday); // Obtain the day of the week from January 1, 1st day of this month.
$ Monthday = date ("t"); // The number of days of the month
$ Startlow = ($
When I was writing a file system, I took a fancy to a foreign HTML template... there was a calendar on it and I wanted to write it out in PHP...
The code is as follows:
$ Monthoneday = date ("Ym"). "01 ";$ Oneweekday = date ("w", strtotime ($ monthoneday); // Obtain the day of the week from January 1, 1st day of this month.$ Monthday = date ("t"); // The number of days of the month$ Startlow = ($ on
This article brings you the content is about PHP implementation of the full calendar of the code, there is a certain reference value, the need for friends can refer to, I hope to help you.
/*
Function written by Nelson Neoh @3/2004.
For the those who wants to utilize this code, please do not remove the this remark.
If you had done a enhancement to this code, please post the copy at Http://www.dev-club.com PHP board. Thank.
Function Usage:calendar (month,year)
*/
function Calendar ($MM, $YYYY) {
if ($MM = = "") $MM = Date ("M");
if ($YYYY = = "") $YYYY = Date ("Y");
if (Checkdate ($MM, 1, $
There are many calendars written in JavaScript on the Internet. These calendars read local time and may be inaccurate. So I want to find a calendar written in php that can read the server time, But I still cannot find a suitable one, so I tried to write it myself. Code copy box$ I % 7 = 6 )? "Class = \" calendarw \"":""). ">"; if ($ I> $ f) echo $ I-$ f; echo "[Ctrl + A select all and copy]
A simple PHP calender (calendar) solves 2038 problems, so it can be used on both 32-bit and 64-bit machines, the code is simple and easy to modify
nbsp; Note 32-bit machine has 2038 problems, so 32-bit server life span 1970 ~2038 years nbsp; We can also use DateTime to circumvent this problem (this is not related to 32-bit 64-bit) nbsp; code as follows: ; HTML; nbsp;return $html; } nbsp;
/*
Function written by Nelson Neoh @3/2004.
For the those who wants to utilize this code, please don't remove this remark.
If you have do any enhancement to this code, please post the copy athttp://www.dev-club.com PHP board. Thank you.
Function Usage:calendar (month,year)
*/
function Calendar ($MM, $YYYY) {
if ($MM = = "") $MM = Date ("M");
if ($YYYY = = "") $YYYY = Date ("Y");
if (Checkdate ($MM,
And everyone to share a simple calendar production process.
Basic requirements:
1. Date of acquisition
2. Get the date given
3. Get a given date is a week
4. Get Month days
5. Access to previous and next month
First put a picture of the effect, the style to do more ugly, do not like to spray.
PHP Code:
-->";
Gets the current year $year =$_get[' y ']?$_get[' y ']:d ate (' Y ');
Gets the c
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.