I'm currently having some trouble trying to decouple this foreach array. It basically prints all checkboxes as a group (widget) in a form.
<?php foreach ($widgets as $id => $widget): ?>
<label for="<?php print $widget->id; ?>">
<?php print $widget->label; ?>
</label>
<?php print $widget->id; ?>
Doing print_r function on $widgets shows the ff: array:
Array
(
[filter-tid] => stdClass Object
(
[widget] =>
Option 1
Option 2
Option 3
[operator] =>
[label] => label here
[id] => edit-id-here
)
[filter-tid_1] => stdClass Object
(
[widget] =>
Option 1
Option 2
Option 3
[operator] =>
[label] => label here
[id] => edit-id-here
)
....... and so on....
How would I go about printing each item in the foreach separately? Thanks.