detecting number of values in an array

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
elecktricity
Forum Contributor
Posts: 128
Joined: Sun Sep 25, 2005 8:57 pm
Location: Trapped in my own little world.
Contact:

detecting number of values in an array

Post by elecktricity »

I would like to know if it's possible to detect the number of values in an array like so:

Code: Select all

<?PHP
$array = array('text1', 'text2', 'text3', 'text4', 'text5', 'text6');
?>
and I would get the number 6 cause there are 6 values in there
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

echo count($array);
Post Reply