1

I have a json record like blow

[{"low":null,"high":10,"type":2,"value":0},{"low":10,"high":60,"type":1,"value":10},{"low":60,"high":null,"type":2,"value":11}]

I would like to create array using this. i tried json_decode its not help i just want create a associative array from this json

any help thank you

2 Answers 2

4

Make sure you're passing true to the second parameter in json_decode(), which specifies that you want an associative array returned.

$arr = json_decode($string, true);

Parameters
 assoc
  When TRUE, returned objects will be converted into associative arrays.

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

Comments

1

see this page : http://php.net/manual/en/function.json-decode.php

use json_decode with this format : json_decode($value,true);

your code : http://pastebin.com/4vdVHjQN

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.