Answers for "count function in php"

PHP
30

php length of array

<?php
	$arr = ["one", "two", "three", "four"];
	echo count($arr);
  ?>
Posted by: Guest on December-29-2019
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
2

count php

$cars = array("Volvo","BMW","Toyota");
echo count($cars); // 3
Posted by: Guest on May-11-2021

Browse Popular Code Answers by Language