I want to offer a free subscription to a website which will never expire.
I decided to define an expiry date
// Define an expiry date for a free subscription|
$free_sub = 9999-12-31 23:59:59;
$free = new DateTime($free_sub);
here is the folowing swich code :
//Now, add subscription perion to calculated expiry date
switch ($period) {
case "w":
// 1 week subscription
$expr_date->modify('+7 days');
break;
case "m":
// 1 month subscription
$expr_date->modify('+1 month');
break;
case "y":
// 1 year subscription
$expr_date->modify('+1 year');
break;
case "f":
// Free basic subscription
$expr_date = $free;
var_dump($free);
exit();
break;
default:
echo "No subscription period selected";
} // End switch
And here is a screenshot of the result:
What is the correct way to define this expiry date ?