2014-05-20 13 views
0

如何從另一個頁面取鏈接example2.com論壇XML重定向鏈接

<response> 
<redirect> 
example2.com 
</redirect> 
<code>0</code> 
<description>OK</description> 
</response> 

其基於example.com鏈接XML基礎知識(信息)

+0

你是怎麼試過的? – fast

+0

有沒有試過 – user3654984

+0

那你做了什麼?什麼地方出了錯? – fast

回答

0

simplexml_load_string()功能解析xml字符串返回數組。

$xml = '<?xml version='1.0'?><response> 
<redirect> 
example2.com 
</redirect> 
<code>0</code> 
<description>OK</description> 
</response>'; 

$array = simplexml_load_string($xml); 

print_r($xml);