<?php
$array = [
['nome' => 'Luis', 'id' => 1],
['nome' => 'Rui', 'id' => 2],
['nome' => 'Joao', 'id' => 3],
['nome' => 'Joaquim', 'id' => 4],
['nome' => 'Jorge', 'id' => 5],
];
$iterator = new RecursiveIteratorIterator(new RecursiveArrayIterator($array));
$nomes = [];
foreach ($iterator as $key => $value)
if ($key == 'nome') $nomes[] = $value;
PD9waHAKICAgICAgICAkYXJyYXkgPSBbCiAgICAgICAgCVsnbm9tZScgPT4gJ0x1aXMnLCAnaWQnID0+IDFdLCAKICAgICAgICAJWydub21lJyA9PiAnUnVpJywgJ2lkJyA9PiAyXSwKICAgICAgICAJWydub21lJyA9PiAnSm9hbycsICdpZCcgPT4gM10sCiAgICAgICAgCVsnbm9tZScgPT4gJ0pvYXF1aW0nLCAnaWQnID0+IDRdLAogICAgICAgIAlbJ25vbWUnID0+ICdKb3JnZScsICdpZCcgPT4gNV0sCiAgICAgICAgXTsKICAgIAkKICAgIAkkaXRlcmF0b3IgPSBuZXcgUmVjdXJzaXZlSXRlcmF0b3JJdGVyYXRvcihuZXcgUmVjdXJzaXZlQXJyYXlJdGVyYXRvcigkYXJyYXkpKTsKICAgIAogICAgCSRub21lcyA9IFtdOwogICAgCQogICAgCWZvcmVhY2ggKCRpdGVyYXRvciBhcyAka2V5ID0+ICR2YWx1ZSkKICAgICAgICAgICAgaWYgKCRrZXkgPT0gJ25vbWUnKSAkbm9tZXNbXSA9ICR2YWx1ZTsKICAgICAgIAogICAgICAgIAogICAgICAgIHZhcl9kdW1wKCRub21lcyk7Cg==