Answers for "php get array count"

PHP
0

php how to count array

$array = ['x', 'y', 'z'];
count($array); // output 3
size_of($array); // output 3
Posted by: Guest on September-22-2021
1

count an array in php

<?php
 $vegetables = ["Cabbage", "Carrot", "Lettuce"];
 $arrayLength = count($vegetables);
 echo $arrayLength; //returns 3
?>
Posted by: Guest on June-20-2021

Browse Popular Code Answers by Language