Simple probably but can't get it right. I need a value out of an session array here's how its build:
print_r($_SESSION); //gives:
Array
(
[cart] => cart Object
(
[config] => Array()
[maincurrency:cart:private] => GBP
)
)
The code so far:
foreach($_SESSION['cart'] as $category => $thing) {
echo $category; //echo's config |the value I need GBP
echo $thing; // echo's Array
if ($category == 'maincurrency:cart:private')
{
echo 'found_it'; //doesn't echo
echo $category; //echo's nothing |the value I need GBP
echo $thing; // echo's nothing
}
}
The string I need is 'GBP' from maincurrency:Test:private.
$categoryis outputtingconfigright there...or yourprint_rof$_SESSION['test']doesn't match what you're saying.$_SESSION['test']is the containing array?