If you want to rearrage an array with two layers (perhaps from database-requests), then use 'array_walk' instead:
<?php
$yamlList = [
['title' => 'hallo ich', 'identifier' => 'ich', 'Klaus'=> 'doof',],
['title' => 'hallo du', 'identifier' => 'du', 'Klaus'=> 'doof',],
['title' => 'hallo er', 'identifier' => 'er', 'Klaus'=> 'doof',],
];
echo ('Input'."\n".print_r($yamlList,true)."\n");
array_walk($yamlList, function (&$value, $key) {
$value = [
$value['title'],
$value['identifier'],
];
});
echo ("\n".'Output'."\n".print_r($yamlList,true)."\n");
?>
The Result
===========
...
Output
Array
(
[0] => Array
(
[0] => hallo ich
[1] => ich
)
[1] => Array
(
[0] => hallo du
[1] => du
)
[2] => Array
(
[0] => hallo er
[1] => er
)
)