What is the best way to display the number of elements in an array in PHP?

To display the number of elements in an array in PHP, you can use the `count()` function. This function returns the number of elements in the array. Simply pass the array as an argument to the `count()` function to get the count.

$array = [1, 2, 3, 4, 5];
$count = count($array);
echo "The number of elements in the array is: " . $count;