Last active
August 29, 2015 14:18
-
-
Save shigwata/c908a9af3ea956aa3c8d to your computer and use it in GitHub Desktop.
月の何週目か取得
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * 月の何週目か取得 | |
| * @param integer $y 年 | |
| * @param integer $m 月 | |
| * @param integer $d 日 | |
| */ | |
| function getNthWeek($y, $m, $d) | |
| { | |
| $week1 = date('W', mktime(0, 0, 0, $m, 1, $y)); | |
| $week2 = date('W', mktime(0, 0, 0, $m, $d, $y)); | |
| $week_num = $week2 - $week1 + 1; | |
| return $week_num; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment