I have converted an array to object data like this:
<?php
$myobject->data = (object)Array('zero','one','two);
print_r($myobject);
?>
And the output is:
stdClass Object ( [data] => stdClass Object ( [0] => zero [1] => one [2] => two ) )
So far so good. But if I try to refer to the numerical keys...
<?php
$myobject->data = (object)Array('zero','one','two);
$counter = 1;
echo $myobject->data->$counter;
?>
...nothing is returned! I would expect it to echo "one".
Am I doing it wrong?