PHP DOMNode insertAfter? PHP DOMNode insertAfter? xml xml

PHP DOMNode insertAfter?


Code Example:

 try {        $li->parentNode->insertBefore( $ul, $li->nextSibling); } catch(\Exception $e){        $li->parentNode->appendChild( $ul ); }


Okay, stupid me. The easy solution is to just go down in the DOM to the nextSibling of the nextSibling and do the same insertBefore... so this is solved.