PHP code example of sloniewski / easy-array

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

    

sloniewski / easy-array example snippets


    $easyArray = new EasyArray([1,2,3,4]);
    $x = $easyArray
        ->map(function($item) { return $item * 2; })
        ->reverse()
        ->last()
    ;
    var_dump($x); // 2