Answers for "how to get the length of an associative array in php"

PHP
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
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
1

array length php

// https://www.php.net/manual/en/function.count.php
$a = array(1,3,5);
echo count($a);
// -> 3
Posted by: Guest on March-19-2021
0

how to get the length of an associative array in php

<?php
  //use count($var) ->
$a[0] = 1;
$a[1] = 3;
$a[2] = 5;
var_dump(count($a));
    
Or

<?php 
  $names = array(Ankur,Raj,Ram,Suresh);
  echo count($names);
 $cars=array(Volvo,BMW,Toyota);
 echo count($cars);
// test

OR

$a = array(1,3,5);
echo count($a);
Posted by: Taylor Swift on March-10-2022
0

how to get the length of an associative array in php

<?php
  //use count($var) ->
$a[0] = 1;
$a[1] = 3;
$a[2] = 5;
var_dump(count($a));

OR

<?php 
  $names = array(Ankur,Raj,Ram,Suresh);
  echo count($names);
 $cars=array(Volvo,BMW,Toyota);
 echo count($cars);
// test

OR

// https://www.php.net/manual/en/function.count.php
$a = array(1,3,5);
echo count($a);
// -> 3
Posted by: Taylor Swift on March-10-2022

Code answers related to "how to get the length of an associative array in php"

Browse Popular Code Answers by Language