I am currently working on a project. I'm suposed to compare a date from my database and the curent date. If the curent date is bigger than the date from the database i am suposed to cound how many times the duration of the item fits in the database date till its bigger than the curent date.
All i got is the curent date, the duration of the item and the date in the database.
What i did befor was use this while loop:
while(date('Y-m-d') > $value->start) {
$value->start= date('Y-m-d', strtotime("+" . $value->contractDuration . " months", strtotime($value->start)));
};
But i'm not allowed to use a while loop. Any clue how to get the same result?