fork download
  1. <?php
  2. // Array representing a possible record set returned from a database
  3. $records = array(
  4. array(2135,'John','Doe'
  5. ),
  6. array(3245,'Sally','Smith'
  7. ),
  8. array(5342,'Jane','Jones'
  9. ),
  10. array(5623,'Peter','Doe'
  11. )
  12. );
  13.  
  14. $first_names = array_column($records, 1);
  15. print_r($first_names);
  16. ?>
  17. // your code goes here
Success #stdin #stdout 0s 82560KB
stdin
Standard input is empty
stdout
Array
(
    [0] => John
    [1] => Sally
    [2] => Jane
    [3] => Peter
)
// your code goes here