how to count array values php counting arrays holds variables script

Mobile
feeds
Welcome Login | Register

how to count array values php counting arrays holds variables script
Reply Your Comments:
Click this button if you are interested in replying to this topic and leave your comments
Sent To Friend
CLick this button if you want to send this page to a friend.
Subsribe To Rss Feeds
Subscribe to RSS
CLick this button if you want to subscribe to this RSS Feed. You can use your browsers feeds burners if you have mozilla or internet explorer 7 or higher and keep up with updates.
  Forums Index
      » PHP Forums
        » » how to count array values php counting arrays holds variables script
how to count array values php counting arrays holds variables script
Post Description: how to count array values php counting arrays holds variables script PHP
Post Tags:
This Post Has Been Viewed 1187 Times Since Mon Feb 11, 2008 2:28 pm Author hostman with 2 replies
how to count array values php counting arrays holds variables script
Advertise On This Page




how do i count the values of how many an array hold?

example:

$items = array("one", "two", "three", "four", "five", "six", "seven");



Leave Your Comments

Share:   Subscribe - Keep Up With This Topic
You can use this HTML code to put it on your website to show your friends this wallpaper. Use this code on your profile like myspace, friendster, Facebook or others. Just Copy and Paste it in your HTML on your websites
URL:
To embed this topic, just copy the code from the "Embed" box. Once you've copied the code, just paste it into your website or blog to embed it.
Embed:
BBCODE is use on forums. You can put this code on all your BBCODE enabled forums like PhpBB, vBulletin® and others. Just Copy and Paste this code on your Posts and Replies on your forums
Fourms BBCODE:
Links Related to : how to count array values php counting arrays holds variables script
Add Link:
No Links Have Been Added To This Topic

Comments and replies About how to count array values php counting arrays holds variables script
:: 1 :: Reply #40749 Reply By lucas On Mon Feb 11, 2008 2:31 pm
lucas:
that's very easy, just use the count() function in php..

you can do this:

PHP CODE:
<?
$items = array("one", "two", "three", "four", "five", "six", "seven");
echo count($items);
?>


OUTPUT
7
:: 2 :: Reply #41106 Reply By Julius On Thu Feb 14, 2008 4:07 am
Julius:
thanks this was helpful. i was storing some values in a comma separated list and converting it to an array with explode and didn't notice the comma at the end of the list nothing after it was being counted as an element and causing problems until i counted the number of value s in the array.