Method: a::extract

Extracts a single column from an array

Info

Syntax

a::extract($array, $key)

Parameters

Return (array)

The result array with all values from that column.

Example


$array[0] = array(
  'id' => 1,
  'username' => 'bastian',
);    

$array[1] = array(
  'id' => 2,
  'username' => 'peter',
);    

$array[3] = array(
  'id' => 3,
  'username' => 'john',
);    

$extract = a::extract($array, 'username');
// output: array(
//    'bastian',
//    'peter',
//    'john'
// );