I am trying to make some table out of a multidimensional array
here is my code
I am getting this error
**Warning: Invalid argument supplied for foreach()
here is an example of the array
www.pastebin.com/m3454956a
any ideas?
I am trying to make some table out of a multidimensional array
here is my code
I am getting this error
**Warning: Invalid argument supplied for foreach()
here is an example of the array
www.pastebin.com/m3454956a
any ideas?
You have an array keyed by TAC between your top array and the employee data. Easily fixed:
foreach ($employees as $tac) {
$emp = $tac['TAC'];
echo $emp['fname']." ".$emp['lname'];
echo "<table>";
foreach($emp['appts'] as $cli => $appts) {
echo "<tr>";
echo "<td>$cli</td>";
echo "</tr>";
}
echo "</table>";
}
If TAC isn't some kind of constant (eg it's some kind of ID) then the solution will differ but there's not enough information to determine that.