- array_map: documentation ( source)
- print_r: documentation ( source)
<?php
$houses = [
['id' => 332, 'title' => 'biba'],
['id' => 2222, 'title' => 'boba'],
['id' => 5566, 'title' => 'aboba'],
];
$result = array_map(
fn(array $item) => [$item['id'] => $item['title']],
$houses
);
print_r($result);