How to get length of an array in PHP ?

Member

cristobal

by cristobal , in category: Technology , a month ago

How to get length of an array in PHP ?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by bailey_conroy , a month ago

PHP count function is used to get the length or numbers of elements in an array

1
2
3
4
5
6
<?php
// initializing an array in PHP
$array=['a','b','c'];
// Outputs 3 
echo count($array);
?>