本文整理汇总了PHP中Zend_Date_DateObject::isYearLeapYear方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Date_DateObject::isYearLeapYear方法的具体用法?PHP Zend_Date_DateObject::isYearLeapYear怎么用?PHP Zend_Date_DateObject::isYearLeapYear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Date_DateObject
的用法示例。
在下文中一共展示了Zend_Date_DateObject::isYearLeapYear方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkLeapYear
/**
* Check a given year for leap year.
*
* @param integer|array|Zend_Date $year Year to check
* @return boolean
*/
public static function checkLeapYear($year)
{
if ($year instanceof Zend_Date) {
$year = (int) $year->get(Zend_Date::YEAR);
}
if (is_array($year)) {
if (array_key_exists('year', $year)) {
$year = $year['year'];
} else {
require_once 'Zend/Date/Exception.php';
throw new Zend_Date_Exception("no year given in array");
}
}
if (!is_numeric($year)) {
require_once 'Zend/Date/Exception.php';
throw new Zend_Date_Exception("year ({$year}) has to be integer for checkLeapYear()", $year);
}
return (bool) parent::isYearLeapYear($year);
}
示例2: checkLeapYear
/**
* Check a given year for leap year.
*
* @param integer|array|Zend_Date $year Year to check
* @return boolean
*/
public static function checkLeapYear($year)
{
if ($year instanceof Zend_Date) {
$year = (int) $year->toString(self::YEAR, 'iso');
}
if (is_array($year)) {
if (isset($year['year']) === true) {
$year = $year['year'];
} else {
require_once 'Zend/Date/Exception.php';
throw new Zend_Date_Exception("no year given in array");
}
}
if (!is_numeric($year)) {
require_once 'Zend/Date/Exception.php';
throw new Zend_Date_Exception("year ({$year}) has to be integer for checkLeapYear()", 0, null, $year);
}
return (bool) parent::isYearLeapYear($year);
}
示例3: checkLeapYear
/**
* Check a given year for leap year.
*
* @param integer|Zend_Date $year Year to check
* @return boolean
*/
public static function checkLeapYear($year)
{
if ($year instanceof Zend_Date) {
$year = (int) $year->get(Zend_Date::YEAR);
}
if (!is_numeric($year)) {
throw new Zend_Date_Exception("year ({$year}) has to be integer for isLeapYear()", $year);
}
return (bool) parent::isYearLeapYear($year);
}