I need to calculate ages depended on birthday from a table of customers.
This is my code:
// customer age
function calculate_customer_age($startDate,$endDate){
$endDate=date(m-d-y);
$startDate= $customer['birthday'];
$fromDate= new DateTime($startDate);
$toDate= new DateTime($endDate);
echo $fromDate->diff($toDate)->days;
}
In the last row, I need to echo age calculated depended on retrieve from a table of a customer from MySQL
.