Check If Date is Past Date in PHP?

I am showing you how to check date if it is past date in php. I am explaining you step by step if date is before today. you can see php check if date before today.

here is the example of how to check if date is past date or not in PHP. so let’s wath both example with output:

<?php
  
    $start_date = strtotime(date('Y-m-d', strtotime('2020-12-01') ) );
    $current_date = strtotime(date('Y-m-d'));
   
    if($start_date < $current_date) {
        echo "yes date is past date";
    }
  
?>

Result:

yes date is past date

Leave a Reply

Your email address will not be published. Required fields are marked *