3v4l.org

run code in 300+ PHP versions simultaneously
<?php //get First day of Month //get Last day of Month $first_day_of_month = mktime(0,0,0,date('n'),1,date('Y')); $last_day_of_month = mktime(23,59,59,date('n'),date('t'),date('Y')); echo "First Day of Month: "; echo $first_day_of_month; echo "<br />"; echo "Last Day of Month: "; echo $last_day_of_month; $datetest = array('05-15-2015','11-30-2014', '11-31-2014', '11-08-2014', '11-8-2014', '11-9-2014', '11-11-2014', '11-24-2014', '11-1-2014', '10-30-2014', '12-1-2014', '11-1-1997'); echo "<br /><br />\n\n"; foreach ($datetest as $datetest) { $split_date = explode("-",$datetest); $comp_date = mktime(0,0,0,$split_date[0],$split_date[1],$split_date[2]); if (($comp_date >= $first_day_of_month) && ($comp_date <= $last_day_of_month)){ echo "$datetest :"; echo " Is in Month!"; echo "<br />\n"; } else { echo "$datetest :"; echo "Not in Month!"; echo "<br />\n"; } }
Output for git.master, git.master_jit, rfc.property-hooks
First Day of Month: 1430431200<br />Last Day of Month: 1433109599<br /><br /> 05-15-2015 : Is in Month!<br /> 11-30-2014 :Not in Month!<br /> 11-31-2014 :Not in Month!<br /> 11-08-2014 :Not in Month!<br /> 11-8-2014 :Not in Month!<br /> 11-9-2014 :Not in Month!<br /> 11-11-2014 :Not in Month!<br /> 11-24-2014 :Not in Month!<br /> 11-1-2014 :Not in Month!<br /> 10-30-2014 :Not in Month!<br /> 12-1-2014 :Not in Month!<br /> 11-1-1997 :Not in Month!<br />

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:
54.52 ms | 402 KiB | 8 Q