I want to see the difference of days between the current date and the input data, but I get this error.
Fatal error: Call to a member function diff () on string in
This is the code:
<input type="date" class="datapicker" required="" name="VEHICLE_DATE_EXPIRATION_SURELY" value="<?php $fechabd1= $fila["VEHICLE_DATE_EXPIRATION_SURELY"];
if($fechabd1==""){
}
else{
echo $fechabd1->format('Y-m-d');
}
?>" min="<?php date_default_timezone_set('America/Bogota'); $fechaactual1 = date("Y-m-d");ECHO $fechaactual1; ?>">
<?php
$fechahoy=date("Y/m/d");
$interval = $fechahoy->diff($fechabd1);
echo $interval->format('%R%a días');
?>