how to compare 2 dates in php?

$exp_date = “2006-01-16”;

$todays_date = date(“Y-m-d”);

$today = strtotime($todays_date);

$expiration_date = strtotime($exp_date);

if ($expiration_date > $today)

{

$valid = “yes”;

} else {

$valid = “no”;

}

Advertisements

About lorddisk

WebCenter Content, WebCenter Portal, WebCenter Sites,Weblogic, Identity and Access Management (IAM),SSO,OAM,OIM,OAAM,OUD, OPAM,OID, OVD ,Oracle API Gateway ,OBIEE,OEDQ, Oracle ADF, Oracle SOA,J2EE, CackePHP ,PHP,J2SE,J2EE,Spring,Hibernate,JQuery,CSS,Java Script ,Joomla,Drupal,Worpress
This entry was posted in php and tagged , . Bookmark the permalink.