Chrome Extension

Length of array PHP

$fruits = array("banana", "apple", "orange");
echo count($fruits);
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place. Check how cool is the tool
Output
3

You can get the length of an array in PHP by using count function. In the code snippet, we are counting $fruits variable values.

Was this helpful?
0 Comments
Join Devsheet Ask a Question