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
Post a Comment