0
我想從XML獲得最新的評論。一個例子可以在這裏找到:http://dev.smoige.com/discussion.xml?DiscussionID=8。我設法得到LastCommentID,我們可以說是37,可以在這種格式<CommentID>37</CommentID>
中找到,下面是這個:<Body>this is my damn comment!</Body>
,我真的在這之後。我如何使用LastCommentID來選擇正確的CommentID並獲取它的正文?使用PHP獲取XML數據。卡住?
請幫忙。
$latestXml = 'http://dev.smoige.com/discussion.xml?DiscussionID='.$Discussion->DiscussionID;
if(!$xml=simplexml_load_file($latestXml)){
trigger_error('Error reading XML file',E_USER_ERROR);
}
foreach($xml as $user){
$last = $user->LastCommentID.' ';
}
謝謝
感謝您的幫助的人。無法做任何事情,但我會繼續努力。 – Ciprian