How to echo xml file in php

前端 未结 10 912
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-29 04:37

How to print an xml file to the screen in php?

This is not working:

$curl = curl_init();        
curl_setopt ($curl, CURLOPT_URL, \'http://rss.news.y         


        
10条回答
  •  一个人的身影
    2020-11-29 05:03

    You can use the asXML method

    echo $xml->asXML();
    

    You can also give it a filename

    $xml->asXML('filename.xml');
    

提交回复
热议问题