Object of class stdClass could not be converted to string error

前端 未结 6 1206
一生所求
一生所求 2021-01-05 00:12

I have the following string:

{\"Coords\":[{\"Accuracy\":\"65\",\"Latitude\":\"53.277720488429026\",\"Longitude\":\"-9.012038778269686\",\"Timestamp\":\"Fri J         


        
6条回答
  •  情深已故
    2021-01-05 00:21

    Try using this $decoded_traces=json_decode($traces, true);

    instead of this $decoded_traces=json_decode($traces);

    It will convert your stdClass to array. Note that $decoded_traces is array then you can use as you require.

提交回复
热议问题