How do you compare current date to date in php?

1 answer

Answer

1186139

2026-03-31 04:11

+ Follow

Here is the code



$variable_date = '4/22/2013'; // Just add your string variable here
$date_to_check = date('m/d/Y', strtotime($variable_date));
$current_date = date('m/d/Y');
echo "Current Date is ".$current_date."
";
echo "Date to check is ".$date_to_check;



?>

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.