Skip to content
Advertisement

Cant access Json Array values created by json_decode

My json_decode() is returning an array but i just cant seem to access it. Here’s as much of information i think would be useful. I’m pulling a json value from a server using curl commands.

The response (output) from the server :

JavaScript

enter image description here

JavaScript

Converting the json formatted string to json array:

JavaScript

output: enter image description here

JavaScript

Clearly $res prints as Array for some reason, and when trying to print $res[“automat”] it doesn’t t print anything at all. I’ve checked the console and there is no errors.

Solutions already tried with no result :

JavaScript

Any further information can be provided if asked.

Advertisement

Answer

You are trying to echo a bool with a false value. It will not return/print anything.

You can test this, be executing the following code:

JavaScript

This will give your output:

JavaScript

In order to see something from your example, use another key for this:

JavaScript

P.S. Don’t use images for showing source code.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement