Week list for the current date in PHP

Dátumok hétfőtől vasárnapig , egy tetszőleges dátum alapján.

// set current date
$date = ’04/30/2009′;
// parse about any English textual datetime description into a Unix timestamp
$ts = strtotime($date);
// calculate the number of days since Monday
$dow = date(‘w’, $ts);
$offset = $dow – 1;
if ($offset < 0) { $offset = 6; } // calculate timestamp for the Monday $ts = $ts - $offset*86400; // loop from Monday till Sunday for ($i = 0; $i < 7; $i++, $ts += 86400){ print date("m/d/Y l", $ts) . "\n"; } https://www.redips.net/php/week-list-current-date/comment-page-2/

B logbook : PHP | Javascript | Laravel | CodeIgniter | VueJs | ReactJs | WordPress

Translate »