6

I have the following object:

[Suppliers] => stdClass Object
                (
                    [@size] => 1
                    [name] => Supplier Name
                    [Supplier] => stdClass Object
                        (
                            [@chainCode] => EP
                            [@id] => 13
                        )

                )

I know how to get the name property and display it, but I don't know how to get the properties that start with an '@' sign ... What is it and how can I get its value?

NikiC
  • 100,734
  • 37
  • 191
  • 225

1 Answers1

13

It's just properties with a somewhat unusual name. You can fetch them like this:

$object->{'@id'};
NikiC
  • 100,734
  • 37
  • 191
  • 225
  • The output is produced by an API ... I've tried your way and it worked! Thanks mate! I've googled for 2 hours about it and nothing! – user1173615 Jan 27 '12 at 14:16
  • Maybe you were looking in the wrong place? http://stackoverflow.com/questions/758449/how-do-i-access-this-object-property – hakre Jan 27 '12 at 14:46