3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $start_date = date("Y-m-d",strtotime("-1 month")); $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 jWQLf
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [start_date] => 2014-09-29 [end_date] => 2014-10-29 [days] => 30 )