-
-
- /**
- * The date function formats and outputs the time in the specified range
- * by bbs.it-home.org
- */
- $stand = "2013-01-";
-
- for ($i = 1; $i $time = strtotime($stand . $i);
- $date[] = date("Ymd", $time);
- }
-
- print_r($date);
- ?>
Copy code
Achieve the effect:
attached,
The date function gets the date of the previous or next day
example:
-
-
//Date definition
- $day = date("Ymd", strtotime("-1 day"));
- echo $day."n";
- $day = date( "Ymd", strtotime("+1 day"));
- echo $day."n";
Copy the code
The effect is as follows:
|