PHP Classes
elePHPant
Icontem

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    
Last Updated Ratings Unique User Downloads Download Rankings
2010-12-15 (5 years ago) RSS 2.0 feedNot enough user ratingsTotal: 287 This week: 1All time: 7,086 This week: 1,047Up
Version License PHP version Categories
array-treatment 1.0Artistic License3.0Data types, Math
Description Author

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
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  
 0%
Total:287
This week:1
All time:7,086
This week:1,047Up