Web Global Net Web Application & Web Development Project Center

Technical Issues => MySQL/PHP => Topic started by: admin on December 21, 2015, 10:59: PM



Title: if then else after or before a specific date
Post by: admin on December 21, 2015, 10:59: PM
<?php
// Show IF Conditional region11
if (strtotime(@$row_rsclassphotos['submit_date']) <= strtotime('2015-12-21')) {
?>
show this
                                                                  
<?php
// else Conditional region11
} else { ?>
                                                                  
Else show this

  <?php }
// endif Conditional region11
?>

>= great than or equal to this date
<= less than or equal to this date


Title: Re: if then else after or before a specific date
Post by: admin on February 01, 2017, 09:50: PM
You can also do this based on the current date



<?php  //expired date start
if(strtotime($row_rsecho_listing['listing_renewal_date']) <= strtotime('now')) {
?>

Expired on <?php echo formatDate($row_rsecho_listing['listing_renewal_date']); ?>
 
<?php // else expired date
} else { ?>

Expires on <?php echo formatDate($row_rsecho_listing['listing_renewal_date']); ?>

<?php }
// end expired date end
?>