我試圖只從 php 中的 json-ld 獲取文章正文,但我不明白如何。我對(duì)從 php 編碼和解碼 json 不太熟悉,所以似乎沒(méi)有任何效果。 "@context": { "@vocab": "http://schema.org/", "goog": "http://schema.googleapis.com/", "resultScore": "goog:resultScore", "detailedDescription": "goog:detailedDescription", "EntitySearchResult": "goog:EntitySearchResult", "kg": "http://g.co/kg" }, "@type": "ItemList", "itemListElement": [ { "@type": "EntitySearchResult", "result": { "@id": "kg:/m/0dl567", "name": "Taylor Swift", "@type": [ "Thing", "Person" ], "description": "Singer-songwriter", "image": { "contentUrl": "https://t1.gstatic.com/images?q=tbn:ANd9GcQmVDAhjhWnN2OWys2ZMO3PGAhupp5tN2LwF_BJmiHgi19hf8Ku", "url": "https://en.wikipedia.org/wiki/Taylor_Swift", "license": "http://creativecommons.org/licenses/by-sa/2.0" }, "detailedDescription": { "articleBody": "Taylor Alison Swift is an American singer-songwriter and actress. Raised in Wyomissing, Pennsylvania, she moved to Nashville, Tennessee, at the age of 14 to pursue a career in country music. ", "url": "http://en.wikipedia.org/wiki/Taylor_Swift", "license": "https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License" }, "url": "http://taylorswift.com/" }, "resultScore": 896.576599 } ]}我只需要文章正文“泰勒·艾莉森·斯威夫特是美國(guó)創(chuàng)作歌手兼演員……”。我如何實(shí)現(xiàn)這一目標(biāo)?
如何從php中的知識(shí)圖api中僅提取文章正文?
料青山看我應(yīng)如是
2022-01-02 20:14:24