freebase API を使用しています。curl 操作の結果を取得したら、json を PHP にデコードします。今、私は属性付きのテキストにアクセスしようとしています。この一連のオブジェクトと配列の奥深くに埋もれています。
stdClass Object
(
[id] => /m/09c7w0
[property] => stdClass Object
(
[/common/topic/description] => stdClass Object
(
[valuetype] => string
[values] => Array
(
[0] => stdClass Object
(
[text] => The United States of America, commonly called the United States and colloquially referred to as...
[lang] => en
[creator] => /user/wikirecon_bot
[project] => wikirecon
[dataset] => /m/0kj4zz_
[citation] => stdClass Object
これは私がこれまでに試したことですが、いくつかのエラーが発生しています。$stuff =$data->property->/common/topic/description->text;
エラーが「/common/topic/description」の結果である可能性があることはわかっています。JSON応答をphpオブジェクトに変換する必要がありますか、それとも最初にjsonで値を見つけようとする必要がありますか? その属性「テキスト」にアクセスする方法はありますか