3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [ Array ( 'nombre_entrada' => 'Entrada General', 'precio_productor' => 250, 'id_funcion' => 907, ), Array ( 'nombre_entrada' => 'Entrada General', 'precio_productor' => 300, 'id_funcion' => 907, ), Array ( 'nombre_entrada' => 'Entrada General', 'precio_productor' => 350, 'id_funcion' => 907, ), Array ( 'nombre_entrada' => '2 entradas x', 'precio_productor' => 400, 'id_funcion' => 907, ) ]; $array2 = [ Array ( 'nombre_entrada' => 'Entrada General', 'precio_productor' => 350, 'id_funcion' => 907, ), Array ( 'nombre_entrada' => '2 entradas x', 'precio_productor' => 400, 'id_funcion' => 907, ), ]; $newArray = []; foreach ($array2 as $item) { $newArray[serialize($item)] = $item; } // next - filter your first array: $filteredArray = array_filter( $array1, function($v) use ($newArray) { // here serialize `$v` and check if key // same as serialized `$v` exists in $newArray return !isset($newArray[serialize($v)]); } ); print_r($filteredArray);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [nombre_entrada] => Entrada General [precio_productor] => 250 [id_funcion] => 907 ) [1] => Array ( [nombre_entrada] => Entrada General [precio_productor] => 300 [id_funcion] => 907 ) )

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