I have an field input="date" in html form and i want to compare the selected date with the current date in php but it s not working
$datan=$_POST['birthday'];
date_default_timezone_set('Europe/Bucharest');
$currentdate = date("Y-m-d");
if(($currentdate-$datan)/365>=18)
{
---do something
}
else echo " Your age is below 18 !"