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 1196 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

Your Name
Your Email Address (Will Not Be Published)
Notify Me When Someone Replies to this Page
(An email will be sent to you when someone replies to your comments)
Your Comments
Include A Picture with your comments
Share
| More
Share this page by putting this URL in your comments to other websites like myspace, Facebook, Twitter friendster, Hi5, Groups, Boards, Forum or others. Just Copy and Paste this Code
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
BBCODE:
Subscribe Feeds
Webmasters - Exchange Links With Us. Add related websites to this topic
Add Link:
Links Related to : how to count array values php counting arrays holds variables script

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.