PHP Questions Home

Categories

Arrays
Files
Forms
Functions
Images
MySQL
Numbers
Others
Strings
Website


PHP Functions

PHP Functions


More PHP

Top Questions
Ask a Question

How do I find the size of an array?


You can find the number of values in an array using the function count, like this:

<?php
$values 
range("A","Z");
echo 
count($values);
?>


This will print "26" to the screen.

Alternatively you can use sizeof($arrayname) instead - it will return the same result.



More arrays PHP Questions

How do I remove and view the last element of an array?
How do you remove duplicate values from an array?
How do I reverse sort the members of an array?
How can I display values in a two dimensional array?
How can I create an array of the letters of the alphabet?