Skip to content

Tag: foreach

Geonames api loop and get city name

How can i get only all city names (eg… Lisbon, Porto, Aveiro…) contained in the array? Here is a sample of the array: Answer For starters, that is a pretty ugly way to get at the data, as you are encoding json data that is already json, and then looping on just pieces of that resulting mangled str…

Foreach array inside of array

I have a JSON data that looks like this (link for full response here https://pastebin.com/LG2F9Vrw) “data”: [ { “matchId”: 1653309, “personId”: 1141434, “teamId”: 89736, “competitors”: [ { “teamCode”: “SHC”, “website&#82…

PHP subtract value of array from 2 arrays [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 1 year ago. Improve this question result1 and result 2 are arrays, with arrays inside. i want to subtract the…