The following code:
$options = $value[$i]['options'];
print_r($options);
outputs the following result:
Array (
[0] => stdClass Object (
[id] => 1
[field_id] => 1
[option_name] => I'm a normal user )
[1] => stdClass Object (
[id] => 2
[field_id] => 1
[option_name] => Store owner )
[2] => stdClass Object (
[id] => 3
[field_id] => 1
[option_name] => Brand owner )
[3] => stdClass Object (
[id] => 4
[field_id] => 1
[option_name] => Designer )
)
So why can't I output "I'm a normal user" using echo $options[0]["option_name"]
?
My plan is to output id
and option_name
using a foreach loop:
foreach ($options as $option)
{
echo "<option value='".$option["id"]."'>".$option["option_name"]."</option>";
}
This should be easy.... but I'm fumbling :(