Skip to content

Instantly share code, notes, and snippets.

@vocolboy
Last active March 14, 2016 03:17
Show Gist options
  • Save vocolboy/165f78aa19579ae9d4f4 to your computer and use it in GitHub Desktop.
Save vocolboy/165f78aa19579ae9d4f4 to your computer and use it in GitHub Desktop.
//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