I am pulling elements from a standard class object into an assoc array like so:
$array = $subjects;
foreach ( $array as $subject ) {
foreach ( $subject as $prop => $val ) {
if ( $val !== '' ) {
echo $prop . ' = ' . $val;
echo "<br>";
}
}
}
I get the result I expect from above, except what I'd like to do is echo out individual values into a table.
When I do this: echo $subject['day1']; I get this: "Cannot use object of type stdClass as array."
Where am I going wrong? Thanks in advance.