Skip to content

Instantly share code, notes, and snippets.

@stefpe
Created April 15, 2019 19:57
Show Gist options
  • Save stefpe/e6ead7b8f1946bfabaf237770e9dac76 to your computer and use it in GitHub Desktop.
Save stefpe/e6ead7b8f1946bfabaf237770e9dac76 to your computer and use it in GitHub Desktop.
flattened array with a simple value
<?php
$array = [
[
'name' => 'Misty',
'age' => 15
],
[
'name' => 'Charlie',
'age' => 40
]
];
var_dump(array_column($array, 'age'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment