: This article describes how to obtain the number of days of the current month, the first and last days of the current month, the first day of the previous month, and the last day of the previous month. if you are interested in the php Tutorial,
Php returns the number of days of the current month and the date array by month and month.
This example describes how to obtain the number of days of the current month and the date array by using php. We will share this with you for your reference.
This article mainly introduces the method by which PHP obtains the number of days of the month and the date array according to the date, related to the relevant judgment, conversion and the traversal operation of the character and array of PHP, and
The example of this article is about how to get the last days of month, the maximum days and the number of days. Share to everyone for your reference, specific as follows:
title page
function Getlastday (year,month)
{
var new_year =
Original link: http://www.jb51.net/article/44468.htm
First, get the last day of the month (possibly 28/29/30/21) problem, the idea is simply to get the first day of the next month, the number of milliseconds from 1970, and then subtract the number
This example describes how PHP obtains the number of days and date arrays by month. Share to everyone for your reference, as follows:
function Get_day ($date) { $tem = explode ('-', $date);//Cut date get year and month $year = $tem [' 0 '];
1.get the first day and last day of the month.echo Date (' y-m-01 ', Strtotime ('-1 month '));echo "";echo Date (' Y-m-t ', Strtotime ('-1 month '));echo "";2.get the first day of the month and the last day.$BeginDate =date (' y-m-01 ', Strtotime
PHP obtains the maximum number of days (the last day) of a month. PHP obtains the maximum number of days of a month (the last day). the last day of the number of days this article describes how PHP obtains the maximum number of days of a month (the
title page
function Getlastday (year,month)
{
var new_year = year; Take the current year
var new_month = month++;//Remove the first day of one months to facilitate calculation (last day is not fixed)
if (month>12) //If
During registration, the number of days of the month changes with the change of the month. this small function is used in many places! & Lt; 5 & gt; change PHP code [php] & lt; selectname & quot; month & quot; id & quot; month & quot; onchange &
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.