<?php
/*
Copyright (c) 2008, reusablecode.blogspot.com; some rights reserved.
Thanks to Jim Mayes for showing me a more elegant solution.
This work is licensed under the Creative Commons Attribution License. To view
a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or
send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California
94305, USA.
*/
// Returns the number of days in a given month (and in the case of February, for the given year).
function MonthDays($someMonth, $someYear)
{
return date("t", strtotime($someYear . "-" . $someMonth . "-01"));
}
echo MonthDays('09','2011'); // ก็เติม $someMonth กับ $someYear เข้าไปก็จะได้จำนวนวันของแต่ละเดือนในปีที่ต้องการครับ
?>