- var_dump: documentation ( source)
- array_intersect_key: documentation ( source)
- array_flip: documentation ( source)
<?php
$arr = array('test' => array('percy' => array('hello' => 'hatcherson'), 'percy' => array('mitchell', 'anderson')));
$allowed = array('test');
$res = array_intersect_key($arr, array_flip($allowed));
var_dump($res);