Answer the question
In order to leave comments, you need to log in
How do I force a DOMDocument to close a tag the way I want?
I have in xml variable
<parent>
<item atr="some"></item>
</parent>
$doc = new \DOMDocument();
$doc->loadXML($xml);
$doc->save(path);
<parent>
<item atr="some"/>
</parent>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question