Level 53
How to read this data from $obj
Which data? It's an object, you can access any field with $obj->field, for example $object->weather[0]->description.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I try to use json data from weather api. How to read this data from $obj.
dd($obj);
{#522 ▼
+"coord": {#524 ▶}
+"weather": array:1 [▼
0 => {#509 ▼
+"id": 300
+"main": "Drizzle"
+"description": "light intensity drizzle"
+"icon": "09d"
}
]
+"base": "stations"
+"main": {#518 ▶}
+"visibility": 10000
+"wind": {#512 ▶}
+"clouds": {#511 ▶}
+"dt": 1485789600
+"sys": {#508 ▶}
+"id": 2643743
+"name": "London"
+"cod": 200
}
How to read this data from $obj
Which data? It's an object, you can access any field with $obj->field, for example $object->weather[0]->description.
Please or to participate in this conversation.