3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $start_date = date("Y-m-d",strtotime("-1 month - day")); $end_date = date("Y-m-d",time()); $days = (int) ((strtotime($end_date) - strtotime($start_date))/86400); $info = array( 'start_date'=>$start_date, 'end_date'=>$end_date, 'days'=>$days ); print_r($info);
based on uYBZM
Output for 5.1.0 - 7.1.0
Array ( [start_date] => 1970-01-01 [end_date] => 2014-10-29 [days] => 16372 )
Output for 4.3.0 - 5.0.5
Array ( [start_date] => 2014-09-30 [end_date] => 2014-10-29 [days] => 29 )