2016-09-14 67 views
-2
<?xml version="1.0" encoding="ISO-8859-1"?> 
<note> 
<to>George</to> 
<from>John</from> 
<heading>Reminder</heading> 
<body>Don't forget the meeting!</body> 
</note> 

如何使用PHP來呼應XML信息如何使用simpleXML在php中回顯xml文件?

+0

的可能的複製(http://stackoverflow.com/questions/3577641/how-do-you-parse-and-process- html-xml-in-php) – chris85

+0

如果你在使用SimpleXML發佈特定問題。如果不是這太寬泛,並且是一個dup。 – chris85

回答

0

首先,你需要得到你的XML文件。然後只是迴應你想要的。例如:[?你如何解析和PHP程序HTML/XML]

$file = file_get_contents('http://example.com/rss'); 
echo $file; 
+0

這與SimpleXML沒有關係。 '通過使用simpleXML'。 – chris85