PHP gets this week's Monday specific date method, PHP gets this Monday
This example describes how PHP gets the exact date of the week Monday. Share to everyone for your reference. Specific as follows:
Private Function Mondaytime ($timestamp =0, $is _return_timestamp=true) { static $cache; $id = $timestamp. $is _return_timestamp; if (!isset ($cache [$id])) { if (! $timestamp) $timestamp = time (); $monday _date = Date (' y-m-d ', $timestamp -86400*date (' W ', $timestamp) + (date (' W ', $timestamp) >0?86400:-/*6*86400*/ 518400)); if ($is _return_timestamp) { $cache [$id] = Strtotime ($monday _date); } else{ $cache [$id] = $monday _date; } } return $cache [$id];} echo $this->mondaytime (Time () + 24*3600*2,false); exit;
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/987252.html www.bkjia.com true http://www.bkjia.com/PHPjc/987252.html techarticle PHP gets this week 's Monday specific date method, PHP gets this week Monday This example tells PHP how to get a specific date for this week in Monday. Share to everyone for your reference. Specific as ...