3v4l.org

run code in 300+ PHP versions simultaneously
<?php $firstArray = array( array('startDate' => '05-05-2016', 'endDate' => '10-05-2016'), array('startDate' => '05-06-2016', 'endDate' => '10-07-2016'), array('startDate' => '05-08-2016', 'endDate' => '10-11-2016') ); $secondArray = array(array('date' => '07-05-2016'), array('date' => '12-07-2016'), array('date' => '12-11-2016')); function find_match($index){ global $firstArray, $secondArray; foreach($secondArray as $date){ if(strtotime($date['date']) > strtotime($firstArray[$index]['startDate']) && strtotime($date['date']) < strtotime($firstArray[$index]['endDate'])) return $date['date']; } return null; } foreach($firstArray as $key => $st_dates){ $date = find_match($key); echo ($date != null) ? $date : "No match Found."; echo '<br/>'; }
Output for git.master, git.master_jit, rfc.property-hooks
07-05-2016<br/>No match Found.<br/>No match Found.<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:
67.42 ms | 405 KiB | 5 Q