0

Scribd 的 API 返回 XML,例如:

<?xml version="1.0" encoding="UTF-8"?><rsp stat="ok"><thumbnail_url>http://imgv2-4.scribdassets.com/img/word_document/60906103/111x142/79c5e6bab7/1327030759</thumbnail_url></rsp>

有没有办法快速,说一两行,得到的内容thumbnail_url,那就是http://imgv2-4.scribdassets.com/img/word_document/60906103/111x142/79c5e6bab7/1327030759

4

1 回答 1

4
$xml = simplexml_load_string($string_data);
$url = (string) $xml->thumbnail_url;
于 2012-05-20T01:29:39.610 回答