Home  >  Article  >  php教程  >  PHP根据时间戳返回星期几

PHP根据时间戳返回星期几

WBOY
WBOYOriginal
2016-06-13 10:44:591073browse

02 /** 

03  * 根据时间戳返回星期几 

04  * @param string $time 时间戳 

05  * @return 星期几 

06  */

07 function weekday($time) 

08 { 

09     if(is_numeric($time)) 

10     { 

11         $weekday = array('星期日','星期一','星期二','星期三','星期四','星期五','星期六'); 

12         return $weekday[date('w', $time)]; 

13     } 

14     return false; 

15 } 

16 var_dump(weekday($_SERVER['REQUEST_TIME'])); 

17 ?>

 


摘自:尐桀的博客

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn