3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $dataInicio = '2013-10-14'; $dataFim = '2013-10-28'; list($ano1, $mes1, $dia1) = explode('-', $dataInicio); list($ano2, $mes2, $dia2) = explode('-', $dataFim); $f = mktime(0, 0, 0, $mes2, $dia2, $ano2); $i = mktime(0, 0, 0, $mes1, $dia1, $ano1); $diferencaSegundos = $f - $i; print $f; print ' -- '; print $i; print floor($diferencaSegundos/86400);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
1382914800 -- 138170160014