0
$srt = '{"list":"[{"BP":"94"},{"BP":"99"},{"BP":"85"},{"BP":"84"},{"BP":"95"}]"}'

I want to decode this json object , in

$json_arr2 = array();
$json_arr2  = json_decode($srt,true);

var_dump($json_arr2);

It gives null, please help me to get value from this string in php.

1
  • 2
    Someone named Jason might not like values taken from them. Commented May 24, 2013 at 14:33

2 Answers 2

2

The JSON isn't valid.

Try:

$srt = '{"list":[{"BP":"94"},{"BP":"99"},{"BP":"85"},{"BP":"84"},{"BP":"95"}]}';

http://www.jsonlint.com might help you in future.

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

Comments

0

Use http://www.jsoneditoronline.org/ to check how your json look like.

There should be no " before [ and after ]

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.