Returns the number of elements in an associative array.

Property of

AssocArray

Description

Use count( ) to determine the number of elements in an associative array.

Because associative arrays use arbitrary strings as keys and change size dynamically, you need to get the number of elements in an associative array if you want to loop through its elements.