Skip to content

Instantly share code, notes, and snippets.

@Spriz Spriz/collection.php Secret
Created Mar 20, 2019

Embed
What would you like to do?
<?php
$posts = [
['id' => 1, 'author_id' => 1],
['id' => 2, 'author_id' => 1],
['id' => 3, 'author_id' => 2],
];
$authorIds = (new Collection($posts))->extract('author_id')->toList();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.