<?php
$array = array(array('nome' => 'Luis', 'id' => 1), array('nome' => 'Rui', 'id' => 2));
function recurse($array, $retorno){
foreach ($array as $key => $item) {
if (is_array($item)) $interno[] = recurse
($item, $retorno); else if ($key == 'nome') $interno[] = $item;
}
else $retorno = $interno;
return $retorno;
}
PD9waHAKCiRhcnJheSA9IGFycmF5KGFycmF5KCdub21lJyA9PiAnTHVpcycsICdpZCcgPT4gMSksIGFycmF5KCdub21lJyA9PiAnUnVpJywgJ2lkJyA9PiAyKSk7CgpmdW5jdGlvbiByZWN1cnNlKCRhcnJheSwgJHJldG9ybm8pewoKICAgIGZvcmVhY2ggKCRhcnJheSBhcyAka2V5ID0+ICRpdGVtKSB7CiAgICAgICAgaWYgKGlzX2FycmF5KCRpdGVtKSkgJGludGVybm9bXSA9IHJlY3Vyc2UoJGl0ZW0sICRyZXRvcm5vKTsKICAgICAgICBlbHNlIGlmICgka2V5ID09ICdub21lJykgJGludGVybm9bXSA9ICRpdGVtOwogICAgfQogICAgaWYgKGNvdW50KCRyZXRvcm5vKSkgJHJldG9ybm8gPSBhcnJheV9tZXJnZSgkaW50ZXJubywgJHJldG9ybm8pOwogICAgZWxzZSAkcmV0b3JubyA9ICRpbnRlcm5vOwogICAgcmV0dXJuICRyZXRvcm5vOwp9Cgp2YXJfZHVtcChyZWN1cnNlKCRhcnJheSwgYXJyYXkoKSkpOw==