Home > Backend Development > PHP Tutorial > PHP returns the day of the week based on timestamp_PHP Tutorial

PHP returns the day of the week based on timestamp_PHP Tutorial

WBOY
Release: 2016-07-13 17:46:25
Original
853 people have browsed it

02 /**

03 * Return the day of the week based on the timestamp

04 * @param string $time timestamp

05 * @return day of the week

06*/

07 function weekday($time)

08 {

09 if(is_numeric($time))

10 {

11 $weekday = array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');

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

13 }

14 return false;

15 }

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

17 ?>


Excerpted from: Ji Jie’s blog

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478593.htmlTechArticle?php 02 /**03 * Return the day of the week based on the timestamp 04 * @param string $time timestamp 05 * @return The day of the week 06*/ 07 function weekday($time) 08 { 09 if(is_numeric ($time)) 10 { 11 $we...
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template