Count Number of Elements in an Array using PHP

count function

<?php

$data = [10, 50, 30, 80];
$num = count($data);

echo $num; // 4

Leave a Comment

Cancel reply

Your email address will not be published.