• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Unable to get vlaues from JSON array

Resolved: Unable to get vlaues from JSON array

0
By Isaac Tonny on 16/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I’ve checked number of suggested thread here and tried the solution there but still unable to extract what I want from JSON array.
What I have so far is
This piece of code return array like print_r($response->response->data);
Now I’m trying to access the data [period], [value], etc but when I try with
Shows blank page.
There is no problem when I do print_r($response->response); or print_r($response->response->data); but shows nothing when I go beyond data e.g. print_r($response->response->data->value);
May be is trivial but what is wrong here?

Answer:

As you see, data is an array of objects, so you should access it as an array.

If you have better answer, please add a comment about this, thank you!

arrays json php
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Reshape tensors of unknown shape with tf.function

26/03/2023

Resolved: Use Svelte Component as Slot

26/03/2023

Resolved: Vaadin 14.9 – Redirect on Session Destroy Event

26/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.