Answers for "php size of array"

PHP
30

php length of array

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

how to get length of object in php

$total = count((array)$obj);
Posted by: Guest on November-23-2020
8

get array length using php

// using count() we can get proper length of the array
$names = array("Ankur","Raj","Ram","Suresh");
// pass array into count() as parameter it will return array length
echo count($names);

// output : 4
Posted by: Guest on June-03-2020
1

php array size

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

array size php

<?php

 $cars=array("Volvo","BMW","Toyota");
echo sizeof($cars);
?>
Posted by: Guest on September-22-2021
1

php array length

<?php 
  $names = array("Ankur","Raj","Ram","Suresh");
  echo count($names);
 $cars=array("Volvo","BMW","Toyota");
 echo count($cars);
// test
Posted by: Guest on March-12-2021

Browse Popular Code Answers by Language