Answers for ".length php array"

PHP
30

php length of array

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

php array size

echo count($my_array);
echo sizeof($my_array);    // alias
Posted by: Guest on April-21-2021
1

calculate array length in php

<?php
  //use count($var) ->
$a[0] = 1;
$a[1] = 3;
$a[2] = 5;
var_dump(count($a));
Posted by: Guest on March-31-2021

Browse Popular Code Answers by Language