PHP code example of sevenz / sorter

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

    

sevenz / sorter example snippets


// example
namespace exam/your_programs;

use Sevenz\Sorter;

class Example
{
    $list = [
        [
            'name' => 'John',
            'age' => 25,
        ],
        [
            'name' => 'Anna',
            'age' => 32,
        ],
        [
            'name' => 'Tom',
            'age' => 18,
        ],
        [
            'name' => 'Sarah',
            'age' => 27,
        ],
        [
            'name' => 'Ben',
            'age' => 22,
        ],
    ];

    print_r(Sorter::quick($list, 'name'));
}