note 93124 modified in function.date by danbrown
| From: | danbrown@php.net | Date: | Tue, 25 Aug 2009 01:08:43 +0000 |
| Subject: | note 93124 modified in function.date by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-159855@lists.php.net to get a copy of this message | ||
Get names of days:
<?php
$tz = date_default_timezone_get();
date_default_timezone_set('UTC');
for($i=0; $i<7; $i++)
echo date('D', mktime(12, 0, 0, 1, $i+4, 1970)) . '<br />';
date_default_timezone_set($tz);
?>
Change 'D' to 'l' (lowercase 'L') for full names. Change $i+4 to $i+5
if you want Monday to be the first day of the week.
--was--
Get names of days:
<?php
for($i=0; $i<7; $i++)
echo date('D', mktime(12, 0, 0, 1, $i+4, 1970)) . '<br />';
?>
Change 'D' to 'l' (lowercase 'L') for full names. Change $i+4 to $i+5
if you want Monday to be the first day of the week.
http://php.net/manual/en/function.date.php