Accessing @attribute from php object -


i'm trying access values php object returned api. trying 'total' atribute.

stdclass object (     [@attributes] => stdclass object         (             [status] => ok         )      [invoices] => stdclass object         (             [@attributes] => stdclass object                 (                     [page] => 1                     [per_page] => 25                     [pages] => 1                     [total] => 5                 ) 

my returned object stored in variable called $list.

$list->invoices->attributes->total 

i'm trying echo / print_r that, getting nothing?

any appreciated!

the @ part of property name, can't ignore it.

echo $list->invoices->{'@attributes'}->total; 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -