fork download
  1. <?php
  2.  
  3. // your code goes here
  4.  
  5. $startTimeStamp = strtotime("2016/01/06");
  6. $endTimeStamp = strtotime("2016/01/08");
  7.  
  8. $timeDiff = abs($endTimeStamp - $startTimeStamp);
  9.  
  10. $numberDays = $timeDiff/86400; // 86400 seconds in one day
  11.  
  12. // and you might want to convert to integer
  13. $numberDays = intval($numberDays);
  14.  
  15. echo $numberDays;
Success #stdin #stdout 0.02s 52472KB
stdin
Standard input is empty
stdout
2