Link to home
Start Free TrialLog in
Avatar of FairyBusiness
FairyBusinessFlag for United States of America

asked on

How to track the number of variables in an array?

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??
ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of FairyBusiness

ASKER

Cool
FYI: Using a foreach you can then iterate over its contents:
foreach( $_SESSION['cart'] as $i=>$value )
{
 echo $i . " " . $value . "<br />";
}