We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

How to track the number of variables in an array?

FairyBusiness
on
Medium Priority
345 Views
Last Modified: 2012-05-11
If I have an array that is filled with stored $_GET variables how can I know the stored amount?

Would a simple count($_SESSION['cart']) work??
Comment
Watch Question

CERTIFIED EXPERT
Expert of the Year 2008
Top Expert 2008
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Cool
CERTIFIED EXPERT
Expert of the Year 2008
Top Expert 2008

Commented:
FYI: Using a foreach you can then iterate over its contents:
foreach( $_SESSION['cart'] as $i=>$value )
{
 echo $i . " " . $value . "<br />";
}
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.