How to access a member of an stdClass in PHP that starts with an @

前端 未结 4 397
不知归路
不知归路 2021-01-04 09:10

I have some json object that I decoded, and one of the attributes starts with an \"@\" and I can\'t access the element with php because it throws an error.

          


        
4条回答
  •  囚心锁ツ
    2021-01-04 09:39

    direct access is below from ircmaxwell or Richard Tuin, however you can decode JSON with second param true and recive array insted what could be an easier to access

提交回复
热议问题