03c02-1.php

来自「介绍PHP5的给类型函数应用」· PHP 代码 · 共 18 行

PHP
18
字号
<?php// Set the default timezone to US/Easterndate_default_timezone_set('US/Eastern');// Will return a timestamp of the last day in a month for a specified yearfunction last_day($month, $year) {	// Use mktime to create a timestamp one month into the future, but one	//  day less.  Also make the time for almost midnight, so it can be	//  used as an 'end of month' boundary	return mktime(23, 59, 59, $month + 1, 0, $year);}// Determine the last day for February, 2006$stamp = last_day(2, 2006);// Output the result, it will be: 28echo '<p>The last day for February in 2006 is: ', date('d', $stamp) ,'</p>';?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?