PHP count() Function

The count() function is used to return the length of the array.

Example

[php]<?php
$cars = array("Volvo", "BMW", "Toyota");
echo count($cars);
?>[/php]

In the above statement, we are using count function which is “count($cars)” to get the value of arrays in the echo statement.

It will show the following result

3

Related Posts

Leave a Reply