I'm using PHP 5.2.5 on Debian 'etch' and I'm having trouble decoding a JSON response with json_decode().
Here's the code:
Code: Select all
<?php
$json = {
"status": "ok",
"result": {
"publishers": [
"Jewish Press Pub. Co."
],
"subtitle": "a complete lexicon and work of reference in all departments of knowledge. Prepared under the editorship of Paul Abelson.",
"key": "\/b\/OL7168569M",
"title": "English-Yiddish encyclopedic dictionary",
"coverimage": "\/static\/files\/\/686\/OL7168569M_coverimage_1216390649614686.jpg",
"ocaid": "englishyiddishen02abeluoft",
"lc_classifications": [
"PJ5117 A2"
],
"latest_revision": 4,
"publish_country": "|||",
"last_modified": "2008-07-18T16:50:41.869538",
"authors": [
{
"key": "\/a\/OL2536900A"
}
],
"publish_date": "1915",
"publish_places": [
"New York"
],
"type": {
"key": "\/type\/edition"
},
"subjects": [
"English language -- Dictionaries -- Yiddish"
],
"revision": 4
}
}
$obj = json_decode($json);
print $obj->{'result'};
?>
Code: Select all
Catchable fatal error: Object of class stdClass could not be converted to stringThanks!