Skip to content
Advertisement

Can’t find an reason for illegal string offset when trying to access data from array

It might be something very small that I miss but I have error of Illegal string offset 'Time' in ... when I try to access it.

Here is the array

JavaScript

Here is the code how I try to access the `[‘Obs’][‘Time’]

JavaScript

Any idea what is happening here?

Update: When I try $series['Obs']['Time'] instead of $obs_element["Time"] in the second foreach, it seems to work just fine.

Advertisement

Answer

Just tried your code – and it works just fine:

JavaScript

enter image description here

enter image description here

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