I want to echo how much days are left between a variable and NOW. This is the code
$now = date('Y-m-d');
$daysleft= strtotime($starttheproject -$now);
echo
"Now =".$now.
"<br> Starttheproject =".$starttheproject.
"<br> Daysleft =".$daysleft;
Result of echo:
- Row =2014-10-17
- Starttheproject =2014-10-22
- Daysleft =
Question: How can calculate the number of days, so that the result will be '5' I've been playing with code like this, with no luck:
$daysleft= date('Y-m-d', strtotime($starttheproject -$now));