- array_map: documentation ( source)
- print_r: documentation ( source)
<?php
$data = array(
array('id' => 1, 'name' => 'Bob', 'position' => 'Clerk'),
array('id' => 2, 'name' => 'Alan', 'position' => 'Manager'),
array('id' => 3, 'name' => 'James', 'position' => 'Director')
);
$names = array_map(
function($person) { return $person['name']; },
$data
);
print_r($names);
?>