Sometimes you may need to know how many elements an array is containing.
For example, you got result from a mysql query in an array. Now you want to show total number of results returned by the query.
<?php $my_array = array("value1", "value2", "value3", "value4"); echo count($myarray); ?>
It will return 4.