Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
$string = <<<XML
<?xml version='1.0'?>
<cars>
<car>jeep</car>
<car>toyota</car>
<car>niva</car>
</cars>
XML;
$xml = simplexml_load_string($string);
$car = $xml->addChild('car', 'honda');
print_r($xml);