1. Go to this page and download the library: Download werx/collections 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/ */
werx / collections example snippets
$foo = new \werx\Collections\Collection;
class Foo extends \werx\Collections\Collection
{
}
$foo = new Foo();
$foo = new new \werx\Collections\Collection(['foo' => 'Foo', 'bar' => 'bar']);
$foo = new Foo();
$foo->set(['foo' => 'Foo', 'bar' => 'bar']);
var_dump($foo->count());
# OR
var_dump(count($foo)); // The Collection class implements the Countable() interface.
// 2