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

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.



ASK A QUESTION

More arrays PHP Questions

when we retrieve values from db and show in drop-down list then how can i get selected particular value from drop-down so that programe will go next page??

How do I add to the beginning of an array and find the number of elements in it?

How can I loop through the members of an array?

How do I sort alphanumeric array data correctly?

How do I change: function wordlimit($string, $length = 50, $ellipsis = "...") { $words = explode(' ', strip_tags($string)); if (count($words) > $length) return implode(' ', array_slice($words, 0, $length)) . $ellipsis; else



Custom Search