Skip to content

Instantly share code, notes, and snippets.

View FauziFerdiansyah's full-sized avatar
💤
Let's overwhelmingly increase productivity

Fauzi Ferdiansyah FauziFerdiansyah

💤
Let's overwhelmingly increase productivity
  • Indonesia, Bogor
View GitHub Profile
@FauziFerdiansyah
FauziFerdiansyah / Function.Array-Group-By.php
Created September 9, 2018 07:36 — forked from mcaskill/Function.Array-Group-By.php
PHP : Groups an array by a given key
<?php
if (!function_exists('array_group_by')) {
/**
* Groups an array by a given key.
*
* Groups an array into arrays by a given key, or set of keys, shared between all array members.
*
* Based on {@author Jake Zatecky}'s {@link https://github.com/jakezatecky/array_group_by array_group_by()} function.
* This variant allows $key to be closures.