Home > php教程 > php手册 > body text

PHP根据时间戳返回星期几

WBOY
Release: 2016-06-13 10:44:59
Original
1071 people have browsed it

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 ?>

 


摘自:尐桀的博客

Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!