PHP Classes

Array Treatment: Count array values by given entry names

Recommend this page to a friend!
  Info   View files View files (1)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 299 All time: 7,423 This week: 560Up
Version License PHP version Categories
array-treatment 1.0Artistic License3.0Data types, Math


This class can be used to count array values by given entry names.

It traverses a given array of associative array values and group all entries that have the same value of a given entry.

The class returns an associative array with key entries defined by one given entry, summing all values of another given entry.

Innovation Award
PHP Programming Innovation award nominee
December 2010
Number 6

Prize: One year subscription to the PDF edition of the JSMag magazine
Sometimes you need to sum the values of a given column returned by a database query result and group the results by values of another column.

This class provides a solution for summing values returned in an array just like you would be able to do using SQL GROUP BY clause and SUM function.

Manuel Lemos
Picture of Muhamed Turkanovic
Name: Muhamed Turkanovic <contact>
Classes: 3 packages by
Country: Slovenia Slovenia
Age: ???
All time rank: 22527 in Slovenia Slovenia
Week rank: 286 Up2 in Slovenia Slovenia Up
Innovation award
Innovation award
Nominee: 1x

  Files folder image Files  
File Role Description
Plain text file ArrayTreatment Class function code

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:7,423
This week:560Up