3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = date("Y-m-d"); //w:星期几,0-6 //取得指定时间所属月的第一天 $firstday = date("Y-m-01",strtotime($date)); //取得指定时间所属月的最后一天 $lastday = date("Y-m-d",strtotime("$firstday +1 month -1 day")); //取得指定时间所属月的第一天是星期几 $w = date("w",strtotime($firstday)); //需要往前多取的天数(根据画面显示需要得出) $days_up = $w; //取得指定时间所属月的最后一天是星期几 $w = date("w",strtotime($lastday)); //需要往后多取的天数(根据画面显示需要得出) $days_down = 6 - $w; $start_date = date("Y-m-d",strtotime($firstday) - 86400 * $days_up); $end_date = date("Y-m-d",strtotime($lastday) + 86400 * $days_down); $days = (int) ((strtotime($end_date) - strtotime($start_date))/86400); $info = array( 'start_date'=>$start_date, 'end_date'=>$end_date, 'days'=>$days ); print_r($info);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [start_date] => 2014-09-28 [end_date] => 2014-11-01 [days] => 34 )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
38.87 ms | 401 KiB | 8 Q