1. Go to this page and download the library: Download camillebaronnet/collection 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/ */
camillebaronnet / collection example snippets
public Collection::__construct(...$elements)
public Collection::__construct(\Traversable|array $elements)
$collection = (new Collection('foo', 'bar'))
->map(fn($word) => 'hello '.$word)
->map(fn($word) => strtoupper($word))
;
// The data is computed only here
var_dump($collection->toArray());