Tutorial Details

How to Find Array Length in PHP
18 Nov

How to Find Array Length in PHP

Hi Guys,

In this short tutorial, we will share the quick and straightforward way to php array check length. This article will give you a simple example of how to find array length in php. you can understand the concept of how to get array length in php. you will learn to get PHP Laravel array length.

we will use the count() function to get the array length in php. so, let's see the simple code of how to get the length of the array in PHP.

Example 1:

index.php

<?php
    $array = ['One', 'Two', 'Three', 'Four', 'Five'];  
    $length = count($array);
    var_dump($length);    
?>

 Output:

int(5)

I hope it can help you...

0 Comments

Leave a Comment