FairyBusiness
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??
Would a simple count($_SESSION['cart']) work??
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
FYI: Using a foreach you can then iterate over its contents:
foreach( $_SESSION['cart'] as $i=>$value )
{
echo $i . " " . $value . "<br />";
}
foreach( $_SESSION['cart'] as $i=>$value )
{
echo $i . " " . $value . "<br />";
}
ASKER