Skip to content

Instantly share code, notes, and snippets.

@harikt
Created April 22, 2013 15:16
Show Gist options
  • Save harikt/5435857 to your computer and use it in GitHub Desktop.
Save harikt/5435857 to your computer and use it in GitHub Desktop.
Copied from a nerd wedding invitation
<?php
class Wedding
{
protected $start;
protected $end;
public function __construct($start = '2013-04-22 09:45', $end = '2013-04-22 10:15')
{
$this->start = $start;
$this->end = $end;
}
public function start()
{
if (date('Y-m-d H:i') >= $this->start && date('Y-m-d H:i') <= $this->end) {
echo "Wedding bells!" . PHP_EOL;
echo "Hari weds Sangeetha" . PHP_EOL;
}
}
}
$wedding = new Wedding();
$wedding->start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment