# Count PHP Subarray

**URL:** <https://forum.kirupa.com/t/count-php-subarray/326099>\
**Category:** programming\
**Created:** [November 22, 2011, 9:51pm UTC](https://forum.kirupa.com/t/count-php-subarray/326099 "2011-11-22T21:51:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NewHeart42108](https://avatars.discourse-cdn.com/v4/letter/n/8e8cbc/32.png) [@NewHeart42108](https://forum.kirupa.com/u/NewHeart42108)\
**Post date:** [November 22, 2011, 9:51pm UTC](https://forum.kirupa.com/t/count-php-subarray/326099/1 "2011-11-22T21:51:24Z")

</div>

I have an array in PHP in the format

```auto

Array (     
[0] => Array ( [class] => 14 [Owner] => 89)
[1] => Array ( [class] => 15 [Owner] => 6634)    
[2] => Array ( [class] => 15 [Owner] => 6837)
...
)

```

I would like to get a count of how many elements are in each class; e.g.how many class 15 elements are in the array.

TIA,  
Doug
