If I delete an element inside an element, and if its the last element, then the parent element gets shortened to an empty element.
Example:
Start:
<element><child1>Inner HTML</child1><child2>Inner HTML</child2></element>
I delete Child2 and I get:
<element><child1>Inner HTML</child1></element>
I delete Child1 and I get:
<element/>
Now I want that to not happen or at least a way to detect if the element is empty so I can replace it. How can I do that using DOMDocument in PHP.
Thanks...