Common time method Public function Invitationtime ($type, $v) {if ($type ==1) {//Today $beginToday = Mktime (0,0,0,date (' m '), date (' d '), Date (' Y ')); $endToday = Mktime (0,0,0,date (' m '), date (' d ') +1,date (' Y '))-1; $where = "Superior
This MondayEcho date ('Y-m-d', (Time ()-(date ('W') = 0? 7: Date ('W')-1) * 24*3600); // W indicates the number of weeks. 0 indicates Sunday.This SundayEcho date ('Y-m-d', (Time () + (7-(date ('W') = 0? 7: Date ('W') * 24*3600); // W is also used,
Can the following code be abbreviated? Is there a simple way to implement the following code? I think it is too complicated to write this code. if I write data for a month, wouldn't I need to write 30 cases?
Please help me. I am a newbie.
Php obtained last week, this week, last month, this month, and this quarter. Source: http://hudeyong926.iteye.com/blog/729193< ;? Phpechodate ("Ymd", strtotime ("now"), "\ n"; echo php get last week, this week, last month, this month, this quarter,
Php obtained last week, this week, last month, this month, and this quarter. Source: hudeyong926.iteye. comblog729193 & lt ;? Phpechodate (Ymd, strtotime (now), n; echodate (Ymd, strtotime (-1 weekMonday), n; php get last week, this week, last month,
The following code is not a simple way to achieve ah, I think this is too complicated to write, if you write one months of data, it is not necessary to write 30 case
I'm a novice, I beg the hero's help
Reply to discussion (solution)
I don'
Number of days of the week in a loop (the red letter shows the number of days of the current week) $ week_array = array (1, 2, 4, 5, 6, 7); foreach ($ week_arrayAS $ key = $ value) {if ($ value = date (w) $ value = fontcolor = red. $ valuNumber of
Php obtained last week, this week, last month, this month, and this quarter. Source: hudeyong926.iteye. comblog729193 & lt ;? Phpechodate (Ymd, strtotime (now), n; echodate (Ymd, strtotime (-1 weekMonday), n; echoda php get last week, this week,
Today is the day of the week in many ways, this article has compiled three commonly used, interested friends can understand
The code is as follows:
// Method 1
$ Da = date ("w ");
If ($ da = "1 "){
Echo "Today is Monday ";
} Else if ($ da = "2
Php returns the current date or the specified date is the day of the week
PHP day of the week to get the code:
Date ("l"); // data can be used to obtain the week in English, such as Sunday.
Date ("w"); // you can obtain the
For details about the date () date and Time Functions in php, refer.
For details about the date () date and Time Functions in php, refer.
1, year-month-day
Echo date ('Y-m-J ');
2007-02-6
Echo date ('Y-n-J ');
07-2-6
Uppercase Y indicates
For details about the date () date and time functions in php, refer. 1, year-month-day
Echo date ('Y-m-J ');
2007-02-6
Echo date ('Y-n-J ');
07-2-6
Uppercase Y indicates four digits of the year, while lowercase y indicates two digits of the
The following small series for you to share a PHP to get the first few weeks of the start date and the end date of the instance, has a good reference value, I hope to be helpful to everyone. Let's take a look at it with a little knitting.
The
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.