Can I include PHP in an XML file?

前端 未结 2 1573
余生分开走
余生分开走 2021-01-26 11:50

I am trying to create an automatic \"sitemap.xml\", I already followed the instructions provided by Google to create one, and here is what I currently have:

<         


        
2条回答
  •  失恋的感觉
    2021-01-26 12:14

    I, personally have never used include when creating a site map but I wouldn't see it as a problem as long as you are using valid xml elements.

    You can create your xml using some of the php classes for it and just defining your content type like: header ("Content-type: text/xml; charset=UTF-8"); and from there you can instantiate your xml classes if you chose or do it all by hand

提交回复
热议问题