Learn from:http://www.phpernote.com/php-function/1019.html
Direct Sticker Code:
1<?PHP2 Header(' content-type:text/html; Charset=utf-8 ');3 4 $date=Date(' y-m-d ');//Current Date5 6 $first= 1;//$first =1 represents a start date of Monday for every Sunday for a start date of 07 8 $w=Date(' W ',Strtotime($date));//gets the first day of the current week Sunday is 0 weeks a to Saturday is 1-69 Ten $now _start=Date(' y-m-d ',Strtotime("$date-". ($w?$w-$first: 6). ' Days ');//gets the start date of the week, if $w is 0, then represents Sunday, minus 6 days One A $now _end=Date(' y-m-d ',Strtotime("$now _start+6 days "));//end of week date - - $last _start=Date(' y-m-d ',Strtotime("$now _start-7 Days "));//last week start date the - $last _end=Date(' y-m-d ',Strtotime("$now _start-1 days "));//last week end date - - Echo' Start date of the week: ',$now _start, ' <br/> '; + Echo' This week's End date: ',$now _end, ' <br/> '; - Echo' Last week start date: ',$last _start, ' <br/> '; + Echo' Last week's End date: ',$last _end, ' <br/> '; A?>