I'm getting a PHP array from a web page (as a string). It looks like :
Array
(
[k1] => Array
(
[a] => Array
(
[id] => 1
[age] => 60
)
[b] => Array
(
[id] => 2
[age] => 30
)
)
[k2] => v2
)
I want to parse it in python. Does anyone have an idea how to do this?
Thanks, Rivka
Edit: This is really not a json, like a few people commented. Thanks for the comments, and I updated the question.
json_encode($array);
in PHP to get proper JSON. – Pekka May 30 '11 at 8:39