I need to write a php script that determines the amount the user has to pay depending on the date they register. The later they register the more they pay, so here's the basic code for the script:
private $date;
function __construct() {
$this->date = getdate();
}
function get_amount()
{
$day = $this->date["mday"];
$month = $this->date["month"];
$year = $this->date["year"];
$date = $day.$month.$year;
switch($date) {
case "26October2012":
return "800";
break;
case "26Novermber2012":
return "900";
break;
}
}
But obviously this case statement doesn't work as it should. So if the user register before 26th October 2012 then they pay 800, if it's before 26th November but after 26th October then they pay 900. So how exactly do I code that logic?