
<? 
 //$dExpiryDate = mktime(0, 0, 0, date("m")  , date("d")+5, date("Y"));
        $date1 = strtotime(now);
		$date2=strtotime($expire_date);
    if ($date2 > $date1)
    { 
      $date1 = date("d-m-Y H:i:s",$date1);
      $date2 = date("d-m-Y H:i:s",$date2); 

      $dateFrom=$date1;
      $dateTo = $date2;

      $diffd = getDateDifference($dateFrom, $dateTo, 'd'); //user defined  function 
      $diffh = getDateDifference($dateFrom, $dateTo, 'h');
      $diffm = getDateDifference($dateFrom, $dateTo, 'm');
      $diffa = getDateDifference($dateFrom, $dateTo, 'a');

      if ($diffa['days'] == 0)
      {
        if ($diffa['hours'] == 0)
        {
          $string_difference = $diffa['minutes'] . 'm.<br>';
        }
        else
        {
          $string_difference = $diffa['hours'] . 'h ' . $diffa['minutes'] . 'm.<br>';
        }
      }
      else
      {
         $string_difference = $diffa['days'] . 'd ' . $diffa['hours'] . 'h ' . $diffa['minutes'] . 'm.<br>'; 
      }
    // print $string_difference;
   }
   else
   {
   //  print "Duration Expired";
    $string_difference = "Duration Expired";
   }
   
?>

