How to take the first value after json decode?

foreach ($region_get_all->{"regions"} as $value) {
          echo $value->{"region-id"}[0];
        }

I use curl to match the data
$region_get_all- > {"regions"} is already json_decode
I want to get the first data of those numbers (region-id)
in this way, he says 55555555.

if you don"t add [0], all id will be displayed

now I am object, not array

.

Please take a look at official document . The second parameter of the json_decode function is set to true and it returns Array.

Menu