Try Amazon Prime for 30 days

Buy best selling Linux books

<< View More Computer Tips

Added On: 15/12/15   |    Category: PHP5    |    Number of Views: 188

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.

<?php
$colours=array("Blue","Red","Green","Orange");
echo "There are ". count($colours) ." elements in this array";
?>

Search

Services

The Linux Foundation

Best selling Unix / Linux books
Nvidia Graphics Cards
Save 15% off .CO.UK domains at 123-Reg
Save 15% off .COM domains at 123-Reg
cPanel Hosting Plans
Xilo Web Hosting Plans