3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array ( 0 => array ( 0 => 'Project_id', 1 => 'Id_autre', 2 => 'App', 3 => 'App_lib', ), 1 => array ( 0 => '15685', 1 => '14950', 2 => '14950_APP1', 3 => 'TEST 01', ), 2 => array ( 0 => '16129', 1 => '14950', 2 => '14950_APP1', 3 => 'TEST 01', ), 3 => array ( 0 => '16100', 1 => '15600', 2 => '15600_APP2', 3 => 'TEST 02', ), 4 => array ( 0 => '16200', 1 => '15600', 2 => '15600_APP2', 3 => 'TEST 02', ), 5 => array ( 0 => '18000', 1 => '15700', 2 => '15700_APP3', 3 => 'TEST 03', ), ); function unique_multidim_array($array, $key) { $temp_array = array(); $i = 0; $key_array = array(); foreach($array as $val) { // Do a check if the value is_numeric if(is_numeric($val[0])){ // Search array in $key_array if doenst exists add if (!array_search($val[$key], $key_array)) { $key_array[$i] = $val[$key]; $temp_array[$i] = $val; } else { // Search array and if it does exists replace the array. $key_array[array_search($val[$key], $key_array)] = $val[$key]; $temp_array[array_search($val[$key], $key_array)] = $val; } } $i++; } return $temp_array; } $details = unique_multidim_array($array,3); print_r($details);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [1] => Array ( [0] => 16129 [1] => 14950 [2] => 14950_APP1 [3] => TEST 01 ) [3] => Array ( [0] => 16200 [1] => 15600 [2] => 15600_APP2 [3] => TEST 02 ) [5] => Array ( [0] => 18000 [1] => 15700 [2] => 15700_APP3 [3] => TEST 03 ) )

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:
133.35 ms | 406 KiB | 5 Q