3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $time_variant = array( 'group_a' => array( '0' => array( 'id_variant' => 122, 'name' => '3 hour 30 min', 'time' => 12600 ), '1' => array( 'id_variant' => 173, 'name' => '3 hour', 'time' => 10800 ), '2' => array( 'id_variant' => 271, 'name' => '1 hour', 'time' => 3600 ), ), 'group_b' => array( '0' => array( 'id_variant' => 107, 'name' => '1 hour 30 min', 'time' => 5400 ), '1' => array( 'id_variant' => 321, 'name' => '3 hour', 'time' => 10800 ), ), 'group_c' => array( '0' => array( 'id_variant' => 28, 'name' => '1 hour', 'time' => 3600 ), '1' => array( 'id_variant' => 98, 'name' => '3 hour', 'time' => 10800 ), '2' => array( 'id_variant' => 157, 'name' => '2 hour', 'time' => 7200 ), '3' => array( 'id_variant' => 158, 'name' => '1 hour 30 min', 'time' => 5400 ), ), ); $result = array( '0' => array( 'id_variant' => 173, // mo matter - 173, 321 or 98 'name' => '3 hour', 'time' => 10800 ), );
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0