tags:

views:

107

answers:

4

I've googled this but found no answers, so I guess it's not possible. If there is a way, I'd love to know it. Thanks

+3  A: 
$array = array('one', 'two', 'three');
echo count($array);

http://lv.php.net/count

binaryLV
+4  A: 

The number of keys in the array will always be equivalent to the number of elements in the array, as the keys must be unique. So:

$numKeys = count($array);
Tom Haigh
+2  A: 
count(array_keys($array));
ZZ Coder
+3  A: 

Array is as long as its keys, you can use either of count or sizeof eg

echo count($your_array);

or

echo sizeof($your_array);
Sarfraz