PHP Classes

PHP Collection to Array: Manipulate a collection of values using arrays

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 71 This week: 1All time: 10,270 This week: 42Up
Version License PHP version Categories
collection-class 1.0GNU Lesser Genera...5PHP 5, Data types
Description 

Author

This class can manipulate a collection of item values using arrays.

It provides several functions to manipulate the items of a collection.

Currently, it can:

- Get the list of collection items

- Get a string to represent the collection items in JSON format

- Get the value of the first collection item

- Get the value of the last collection item

- Get the count of items in the collection

- Traverse the collection items and invoke a callback function for each value

- Traverse the collection items and invoke a callback function for each value

- Traverse the collection items and invoke a callback function for each item

- Traverse the collection items and invoke a filter function for all items

- Traverse the collection items and invoke a map function for all items

- Get an iterator object to traverse all collection items

Picture of mohammad anzawi
  Performance   Level  
Name: mohammad anzawi <contact>
Classes: 8 packages by
Country: Jordan Jordan
Innovation award
Innovation award
Nominee: 2x

Example

<?php

include_once('Collection.php');

$db = new PDO("mysql:host=localhost;dbname=collection", "homestead", "secret");

$posts = $db->query("SELECT * FROM posts");
$posts = $posts->fetchAll(PDO::FETCH_OBJ);


Details

collection-class

collection class - ???? ????? ????????

??? ????? ?? ????? ????? ??????

????? ?????? ??????? ?? ??? :

  • ????? ?????: http://goo.gl/wbo0xA
  • ????? ?????? : http://goo.gl/Hs0JHc
  • ????? ?????? : http://goo.gl/8zEbKr

  Files folder image Files (3)  
File Role Description
Accessible without login Plain text file Collection.php Class Class source
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file README.md Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:71
This week:1
All time:10,270
This week:42Up