3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = Array ( "0" => Array ( "rut" => 333333333, "inscripcion_id" => 3940 ), "1" => Array ( "rut" => 444444444, "inscripcion_id" => 3941 ), "2" => Array ( "rut" => 333333333, "inscripcion_id" => 3985 ), "3" => Array ( "rut" => 555555555, "inscripcion_id" => 3987 ) ); $unique_array = array(); $unique_value = array_keys(array_count_values(array_column($arr1, "rut") ), 1, true); foreach ($arr1 as $key => $inner_arr) { if (in_array($inner_arr["rut"], $unique_value) ) { $unique_array[] = $arr1[$key]; unset($arr1[$key]); } } echo print_r($arr1, true); echo print_r($unique_array, true);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [rut] => 333333333 [inscripcion_id] => 3940 ) [2] => Array ( [rut] => 333333333 [inscripcion_id] => 3985 ) ) Array ( [0] => Array ( [rut] => 444444444 [inscripcion_id] => 3941 ) [1] => Array ( [rut] => 555555555 [inscripcion_id] => 3987 ) )

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