How do I access a variable from an stdClass object within an Array of Arrays?
I did a print_r on my array $total and it returned the following:
Array ( ) Array ( ) Array ( ) Array ( ) Array ( [0] => stdClass Object (
[generated] => 6 [magnitude] => 3 [log_pk] => 14 [result] => 0.5000 ) )
Array ( ) Array ( )
I need to be able to print out log_pk from within the stdClass Object. I
have tried print $total[0]->log_pk but that was unsuccessful. The error
was Undefined offset: 0. Any help is appreciated. Thanks.
No comments:
Post a Comment