+1 vote
in Programming by (170 points)
edited by
Hi all,

I need your help.

I want to make a sitemap, using PHP and SQL, and how I show data as XML format.

1 Answer

+1 vote
by (490 points)
selected by
 
Best answer
you can use following code to do this
<?php
$string = <<<XML
<a>
 <b>
  <c>text</c>
  <c>stuff</c>
 </b>
 <d>
  <c>code</c>
 </d>
</a>
XML;
$xml = new SimpleXMLElement($string);
echo $xml->asXML();
?>

 

by (170 points)
thanks, it works :)

131 questions

117 answers

7 comments

378 users

Welcome to Todayask Q&A, where you can ask questions and receive answers from other members of the community.
...