Last active
March 14, 2016 03:17
-
-
Save vocolboy/165f78aa19579ae9d4f4 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
//echo get_chinese_weekday(‘2014-05-26 00:11:12’); | |
public function get_chinese_weekday($datetime) | |
{ | |
$weekday = date('w', strtotime($datetime)); | |
$weeklist = array('日', '一', '二', '三', '四', '五', '六'); | |
return '星期' . $weeklist[$weekday]; | |
} | |
public function get_number_weekday($datetime) | |
{ | |
$weekday = date('w', strtotime($datetime)); | |
$weeklist = array(7, 1, 2, 3, 4, 5, 6); | |
return $weeklist[$weekday]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment