0

How do you parse this json:

a:1:{i:3;a:3:{s:8:"routtype";s:9:"Alpha SS7";s:6:"credit";d:4532.600000000000363797880709171295166015625;s:8:"validity";s:3:"276";}}

to php object or array?

Tried this:

$json = 'a:1:{i:3;a:3:{s:8:"routtype";s:9:"Alpha SS7";s:6:"credit";d:4532.600000000000363797880709171295166015625;s:8:"validity";s:3:"276";}}';

$obj = json_decode($json);
print_r($obj);

with nothing printed.

1
  • Check it out at jsonlint.com Commented Mar 30, 2012 at 10:00

1 Answer 1

6

This is not a JSON string, but a php serialized array. Use http://php.net/unserialize to get what you want.

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

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.