php count how many arrays code example
Example 1: php length of array
<?php
$arr = ["one", "two", "three", "four"];
echo count($arr);
?>
Example 2: how to get length of object in php
$total = count((array)$obj);
<?php
$arr = ["one", "two", "three", "four"];
echo count($arr);
?>
$total = count((array)$obj);