0

I have a sql query which creates a pivot table. Now I've have executed this query in PHP using 'multiquery' and have converted it into JSON using 'json_encode'. The JSON data is consists of around 25million records and the format of each record is

{
timestamp: .....;
value 1: .....;
value 2: .....;
value 3: .....;
value 4: .....;
..
..
..
value n: .....;
}

Now I need to create a chart from this. How should I convert the JSON data into dynamic array so as to create a chart. I'm using dygraphs library.

3
  • this might help stackoverflow.com/questions/41540131/… Commented Mar 12, 2018 at 7:09
  • 2
    Which one are you looking for? Create a chart or convert your array into json? Commented Mar 12, 2018 at 7:09
  • 25million records! Good luck loading that. Commented Mar 12, 2018 at 7:12

2 Answers 2

1

To convert your json to array you can use json_decode with "true" in second parameters: json_decode($json, true);

php doc

Sign up to request clarification or add additional context in comments.

Comments

0

You can convert JSON string to array by using json_decode() function

$newArray = json_decode($json_string, TRUE);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.