PHP code example of andrew-gos / helpers

1. Go to this page and download the library: Download andrew-gos/helpers 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/ */

    

andrew-gos / helpers example snippets


use AndrewGos\Helpers\Helper\HArray;

$array = [['id' => 1, 'value' => 'asdf'], ['id' => 1, 'value' => 'asdf1'], ['id' => 2, 'value' => 'asdf']];
$grouped = HArray::group($array, 'id');
// $grouped = [1 => [['id' => 1, 'value' => 'asdf'], ['id' => 1, 'value' => 'asdf1']], 2 => [['id' => 2, 'value' => 'asdf']]]