I am trying to calculate price for number of days from 1-21 based on date.
$Sql = \' SELECT DISTINCT
a.property_id, a.date,
I have solved this question based on the theory T. Abdelmalek gave me. I made an array and stored date and price of each date in and loped through. The answer has been deleted somehow I don't know how to mark as solved
You can use date_diff
like that:
First date = $leave->getLeaveFrom();
Second date = $leave->getLeaveTo();
$diff = date_diff($leave->getLeaveFrom(),$leave->getLeaveTo());
Results = var_dump($diff);