I have the following code where $fecha_inicio
I bring the value from a query to the DB, and what I need to do, but I don't know how, is to compare the current date and the start date, and if the current date is greater than 2 weeks to issue an alert.
<?php
if($fecha_inicio != null)
{
$fechaActual = date('d-m-Y');
if($fechaActual > $fecha_inicio)
{
echo "ok, falta tiempo";
}
else
{
echo "ya pasó";
}
}
?>
Well for this purpose I know that there is date_diff with which you can calculate the number of days between 2 dates, I leave you a link so you can review it.
However, I leave you a small code that I know will also serve you for this purpose. This code returns the difference in seconds between 2 dates, then you do the conversion to days through a simple calculation and with that you can use that value in the condition.