3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $ar = [ "vasteras"=> [ [ "2017-06-02", "2017-06-12" ], [ "2017-04-01", "2017-04-08", "2017-04-15", ] ] ] ; $result = null; function get($array, $date){ foreach ($array as $item){ if(in_array($date, $item)){ return $item; } } } var_dump(get($ar['vasteras'],"2017-04-01"));
based on BIRa6
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.1
array(3) { [0]=> string(10) "2017-04-01" [1]=> string(10) "2017-04-08" [2]=> string(10) "2017-04-15" }