Dealing with special characters in object property names

前端 未结 1 1824
清歌不尽
清歌不尽 2021-01-25 16:26

I am working with a database created by a university professor\'s intern. Many of the fields have names like \'Revenues_(budget)\'.

Currently when working with objects

1条回答
  •  伪装坚强ぢ
    2021-01-25 17:17

    You can do that in one expression:

    echo $obj->{'Revenues_(budget)'};
    

    0 讨论(0)
提交回复
热议问题