PHP access data of an object

后端 未结 4 2069
野性不改
野性不改 2021-01-20 14:51

I have an object of which I am looking to get a piece of data from, the object looks like this,

    Product Object
(
    [name] => Simon Test Cup
    [co         


        
4条回答
  •  春和景丽
    2021-01-20 15:16

    You could say $object->_related["_related"]["range"], but this structure is presumably that of an object which has accessors for things you might want from it. You're clearly not intended to worry about the internal structure of the thing.

提交回复
热议问题