PHP code example of reekoheek / util

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

    

reekoheek / util example snippets


use ROH\Util\Collection;

// instantiate empty collection
$collection = new Collection();

// instantiate filled collection
$filledCollection = new Collection([
    'foo' => 'bar'
]);

// define attribute
$collection['subCollection'] = $filledCollection;

// get foo of sub collection attribute from parent collection attribute
echo $collection['subCollection']['foo'];