PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

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.



Comment on this Question and Answer >>>

ASK A QUESTION

More arrays PHP Questions

How can I create an array of the letters of the alphabet?

sort

How do you remove duplicate values from an array?

I'm shuffeling through numbers range(1, 10). Can I eval resulting random numbers and convert to appropriate text? 1 = username1, 2 = username2...etc?

How do I sort an array by key?



Custom Search