PHP generated by Date download list method, PHP generated date list
This article describes the method by which PHP generates a download list for the day of the month. Share to everyone for your reference. The implementation method is as follows:
Copy CodeThe code is as follows: function mdy ($mid = "Month", $did = "Day", $yid = "Year", $mval, $dval, $yval)
{
if (empty ($mval)) $mval = Date ("M");
if (empty ($dval)) $dval = Date ("D");
if (empty ($yval)) $yval = Date ("Y");
$months = Array (1 = "January", 2 = "February", 3 = "March", 4 = "April", 5 = "May", 6 = "June", 7 = "July", 8 = "August", 9 = "September", "October", one by one "November", "December";
$out = ""; foreach ($months as $val = + $text) if ($val = = $mval) $out. = "$text "; else $out. = "$text "; $out. = "";
$out. = ""; for ($i = 1; $i <=, $i + +) if ($i = = $dval) $out. = "$i "; else $out. = "$i "; $out. = "";
$out. = ""; for ($i = date ("Y"), $i <= date ("y") + 2; $i + +) if ($i = = $yval) $out. = "$i "; else $out. = "$i "; $out. = "";
return $out;
}
Hopefully this article will help you with JavaScript programming.
http://www.bkjia.com/PHPjc/989568.html www.bkjia.com true http://www.bkjia.com/PHPjc/989568.html techarticle php Generation Date Download list method, PHP generated Date list This example describes the PHP generation date Download list method. Share to everyone for your reference. Concrete implementation methods such as ...