PHP code example of jakezatecky / array_group_by
1. Go to this page and download the library: Download jakezatecky/array_group_by library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jakezatecky / array_group_by example snippets
php
$grouped = array_group_by($records, function ($row) {
return $row->city;
});