Skip to content

Instantly share code, notes, and snippets.

@applehat
Created October 2, 2012 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save applehat/3823420 to your computer and use it in GitHub Desktop.
Save applehat/3823420 to your computer and use it in GitHub Desktop.
Is Caturday?
<?php
/* accepts date as a unix timestamp, a string, or empty for today. */
function is_caturday($date=null)
{
if (is_numeric($date) && $date !== null) {
$time = $date;
} elseif($date !== null) {
$time = strtotime($date);
} else {
$time = time();
}
if(date('D',$time) == 'Sat') {
return true;
} else {
return false;
}
}
/* Example */
echo is_caturday()?"Its Caturday!":"Its not Caturday...boo";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment