Hi!
I have a session array and I'd like a foreach loop to print out the information for me in a html table with each subjectname attached to the right value.
I've tried something like this, but I'm no good at it, so maybe there some faults. Something isn't right, that's for sure..
foreach ($_SESSION[$name] as $key=>$value) {
echo "<table><tr><td colspan='2'> $key : </td></tr>
<tr><td>$value</td>";
}
foreach ($_SESSION[$name] as $key=>$value) {
foreach ($key as $v2) {
echo "<td>$v2</td></tr></table>";
}
My session array is defined like this:
$_SESSION[$name] = array("subject"=>array($_POST['subjectName']),"value"=>array($_POST['fieldValue']));