- array_column: documentation ( source)
- var_export: documentation ( source)
<?php
$array = [
['id' => 1, 'key' => 'foo', 'data' => 'a'],
['id' => 2, 'key' => 'bar', 'data' => 'b'],
['id' => 3, 'key' => 'barf', 'data' => 'c'],
];
var_export(
array_column($array, null, 'id')
);