i have a script that stores the date that a member joins using
$date = date('d-m-Y');
i want to be able to check the current date,
and then find out how many days have past
since the member's join date.
ideally it should end up as
$elapsed = 12;
if 12 days have past.
so i can just check $elapsed and if it is less than 30 days
since the user joined i could offer a discounted purchase
sort like this ...
$cur_date = date('d-m-Y');
function get_join_date(){
//calculate the number of days elapsed,
//and store it as a number in a variable
//named $elapsed
}
if( $elapsed <= 30 ){
//show discounted purchase link
} else {
//show regular purchase link
}
can anyone help with the code for the function?
I'm assuming it is not as simple as subtracting the
$cur_date from $join_date and storing it as $elapsed
Bookmarks