I have to generate a xml file dynamically at runtime. Please help me in generating the below XML file dynamically using PHP.
I'd use SimpleXMLElement.
'); for ($i = 1; $i <= 8; ++$i) { $track = $xml->addChild('track'); $track->addChild('path', "song$i.mp3"); $track->addChild('title', "Track $i - Track Title"); } Header('Content-type: text/xml'); print($xml->asXML());