我擁有@attributes中的所有JSON數據,並希望使用PHP將其提取到變量。
我努力:如何從@attributes獲取json/xml中的數據與PHP
$url = "http://synd.cricbuzz.com/j2me/1.0/livematches.xml";
$xml = simplexml_load_file($url) or die("Error..");
$json = json_encode($xml, JSON_PRETTY_PRINT);
$decode_json = json_decode($json);
$match = $decode_json->match[0];
print_r($match);
這裏是我開始使用上面的代碼的輸出:http://phpfiddle.org/main/code/3zbq-62w0
任何幫助將不勝感激。謝謝..
你可以將結果轉換爲數組,然後使用數組 –