Skip to content
This repository was archived by the owner on Jan 6, 2019. It is now read-only.

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Collection Component

Build Status Scrutinizer Code Quality Latest Stable Version Total Downloads Latest Unstable Version License

Requirements

  • PHP >= 5.4

Installation

$ composer require kasseler/collection

Usage

$collection = new ArrayCollection([
    'one' => 1,
    'two' => 2,
    'three' => 3,
    'four' => 4,
    'five' => 5,
]);

echo $collection->get('one'); // return one key
echo $collection->two; // return two key
echo $collection['three']; // return three key

foreach ($collection as $key => $value) {
    /*
    * return
    * key[one]   = '1';
    * key[two]   = '2';
    * key[three] = '3';
    * key[four]  = '4';
    * key[five]  = '5';
    */
    echo sprintf("\nkey[%s] = '%s';", $key, $value);
}

echo $collection; //return serialize array

unset($collection['four']);
$collection->remove('five');

echo count($collection); // return 3

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages