sizeOf() | How To Print Length of an Array in PHP?

Date Published: 20/03/2020Published By: JaiSchool

PHP gives us a function sizeOf() to count the length of the data stored in an array. sizeOf() is written in camel case.

In sizeOf() method's parameter, pass the array, you want to count the length of. and after that, simply print it by an echo. See the below example:

<?php

$data = ["jaischool","HTML","CSS",5,'a'];
$length = sizeOf($data);
echo $length;

?>

Output:- 5

Publish A Comment

Leave a Reply

Your email address will not be published.