Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php check if weekends

// this will return "true" if its sunday or saturday or false it its not a weekend
function is_sunday(){
	$today = date("Y-m-d");
	$dt1 = strtotime($today);
	$dt2 = date("l", $dt1);
	$dt3 = strtolower($dt2);
	if(($dt3 == "saturday" ) || ($dt3 == "sunday")){
		return true;
	}else{
		return false;
	}
}
 
PREVIOUS NEXT
Tagged: #php #check #weekends
ADD COMMENT
Topic
Name
8+5 =