PHP code example of rodrigodornelles / php-array-lib

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

    

rodrigodornelles / php-array-lib example snippets



use ArrayCreate;                                  # if you using namespaces

$myNewArray = ArrayCreate::from($myOriginalArray) # instantiate pipeline class
  ->map(someItemFunction)                         # first function to iterate on each item
  ->map(anotherItemFunction)                      # next function to iterate on each item
  ->filter(anotherItemFunction2)                  # next function to filter on each item
  ->construct();                                  # returns new array

 

SHELL
$ composer 
JSON
"rodrigodornelles/php-array-lib": "~1.0.0"