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.
<?php//Modify the page encoding header ("Content-type:text/html;charset=utf-8");//Get current year $year=$_get[' y ']?$_get[' y ']:d ate (' y ');// Gets the current month $month=$_get[' m ']?$_get[' m ']:d ate (' m '),//Gets the number of days of the present month $days=date (' t ', Strtotime ("{$year}-{$month}-1"));//Current number of weeks $week =date (' W ', Strtotime ("{$year}-{$month}-1"),//center echo "<center>",//Calculate last month if ($month ==1) {$prevyear =$ Year-1; $prevmonth = 12;} else{$prevyear = $year; $prevmonth = $month-1;} Calculate next month if ($month ==12) {$nextyear = $year +1; $nextmonth = 1;} else{$nextyear = $year; $nextmonth = $month +1;} Output header echo "