Count the number of elements in a PHP5 array using the count() function
To count the number of elements in a php array we use the php count function.
Copy and paste the code below in to your php file.
echo "There are ". count($colours) ." elements in this array";