I fill a session like this:
$_SESSION[$id]=$value;
And I'm reading out the array with this:
foreach($_SESSION AS $value){...}
But how can I read out the $id
of the session too? Array key?
Thanks!
foreach($_SESSION as $key => $value){
}
http://br2.php.net/manual/en/control-structures.foreach.php
You need something like the following:
foreach($_SESSION AS $key => $value) {
echo "$key -> $value";
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With