hi all i have a date displaying in the following format 29-11-2007 i want to calculate expiry date for the above date ie., 30 days to the above date how can i do it please help me
$date = '29-11-2007'; $expires = strtotime("$date + 30 days"); echo date('d-m-Y', $expires); // outputs '29-12-2007'
Thank you NogDog. If i want to check the expiry date is greater than todays date then i should close the session how can i do this
You could just compare $expires to time() (both are "UNIX time" in seconds).
if(time() > $expires) { // it is now 30 days or more past the expiration date }
Thank you NogDog
Don't forget to mark this thread resolved.