If newnode was already inserted in the document it is first unlinked from its existing context.
(PHP 4.3) This function replaces the child oldnode with the passed newnode, even if the new node already is a child of the DomNode. If newnode was already inserted in the document it is first unlinked from its existing context. If the old node cannot be found the function returns FALSE. If the replacement succeds the old node is returned. (This behaviour is according to the W3C specs).