3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array_1 = array( 'ana' => 'are', 'du' => 34, 'bopq'=> "Ana are mere mereu", 13 => "OK" ); $array_2 = array('du', 13); $result = array_intersect_key($array_1, array_flip($array_2)); Var_dump($result);

preferences:
41.04 ms | 406 KiB | 5 Q