PHP code example of ifresh / collection-macros

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

    

ifresh / collection-macros example snippets


// [3, 4]
collect([1, 2, 3, 4])->greaterThan(2); 

// [1, 2]
collect([1, 2, 3, 4])->lessThan(3); 

// 6 (1 * 2 * 3)
collect([1, 2, 3])->multiply();

// ['a', 'b', 'c']
collect(['A', 'B', 'C'])->toLower();

// ['A', 'B', 'C']
collect(['a', 'b', 'c'])->toUpper();