當前位置: 首頁>>代碼示例>>PHP>>正文


PHP date::week方法代碼示例

本文整理匯總了PHP中date::week方法的典型用法代碼示例。如果您正苦於以下問題:PHP date::week方法的具體用法?PHP date::week怎麽用?PHP date::week使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在date的用法示例。


在下文中一共展示了date::week方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: week_days

 public function week_days($year = FALSE, $week = FALSE)
 {
     $w = date::week($year, $week);
     $list = array();
     for ($day = 0; $day <= 6; $day++) {
         $list[] = date('Y-m-d', strtotime($w['year'] . "W" . $w['week'] . $day));
     }
     return $list;
 }
開發者ID:hiltongoncalves,項目名稱:SAPO,代碼行數:9,代碼來源:MY_date.php

示例2: last_day_of_week

 public static function last_day_of_week($year = null, $month = null, $week = null, $format = 'j')
 {
     if ($year === null) {
         $year = date::year();
     }
     if ($month === null) {
         $month = date::month();
     }
     if ($week === null) {
         $week = date::week();
     }
     if ($week == date::weeks_in_month($year, $month)) {
         return date::last_day_of_month($year, $month, $format);
     }
     if ($week > date::weeks_in_month($year, $month)) {
         return 0;
     }
     return date($format, strtotime('this sunday', date::first_day_of_week($year, $month, $week, 'U')));
 }
開發者ID:ThisNameWasFree,項目名稱:rude-univ,代碼行數:19,代碼來源:rude-date.php


注:本文中的date::week方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。