/**
* Return date is the first few weeks
* @param number $style style
* @return Returns a string or a value for calculation
*/
function Get_day_week ($data = false, $style = 0)
{
if ($data) {
$data = $data;
}else{
$data = Date (' y-m-d ');
}
$DAYF = Date (' W ', Strtotime (date (' y-m-01 ')));
$wk _day=date (' W ', Strtotime ($data)); Get today is the day of the week
$date _now=date (' J ', Strtotime ($data)); What's the date today?
$wkday _ar=array (' Day ', ' one ', ' two ', ' three ', ' four ', ' five ', ' VI '); Normalize the expression of the Sunday
$cal _result=ceil (($date _now+ $DAYF-1)/7); Calculation is the first few weeks
if ($style ==1) {
$rs = Date ("Y-year N-month J-Day"). "Week". $wkday _ar[$wk _day]. "-This month". $cal _result. $wkday _ar[$wk _day];
}
else if ($style ==2) {
$rs = "Today is the first of the month". $wkday _ar[$cal _result]. " Weeks ". $wkday _ar[$wk _day];
}else{
$rs = Array ("Cal_result" and "_result" and "wk_day" = $wk _day);
}
return $rs;
}
PHP return today is the first few weeks