I have a customer form in two date fields. Actually I find the days between in customer_birthday date and customer_marriage date. I've tried this code to fulfill my problem but its doesn't work. where I am wrong.
My controller code
$date1 = $_POST['customer_birth']; $date2 = $_POST['customer_marriage']; $datediff = $date1 - $date2; echo floor($datediff / (60 * 60 * 24)); it gives me output: 0
$date1and$date2?