- Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.20, 5.5.0 - 5.5.4
- Parse error: syntax error, unexpected '{' in /in/eT9KM on line 10
Process exited with code 255.
<?php
$arr = array('test' => array('percy' => array('hello' => 'hatcherson'), 'percy' => array('mitchell', 'anderson')));
$allowed = array('percy');
$combined = array();
foreach ($arr as $k => $v) {
if (is_array($v) {
$combined[] = array_intersect_key($arr[$k], array_flip($allowed));
}
}
var_dump($combined);