PHP has many built-in functions for working with XML, including simplexml and DOMDocument. These functions make it easy to create, manipulate, and parse XML data.
Here are some examples:
1. Creating an XML file using simplexml:
$xml = new SimpleXMLElement(''); $movie = $xml->addChild('movie'); $movie->addChild('title', 'The Shawshank Redemption'); $movie->addChild('year', '1994'); $movie->addChild('director', 'Frank Darabont');