A
A
AleDv2014-12-26 16:58:26
RSS
AleDv, 2014-12-26 16:58:26

How to insert new node after root in RSS?

Hello. I am forming an RSS and I want the newly added one to be added after the channel description, and not at the end of the file, if I do the usual appendChild. I found the insertBefor method in the manual, but I can’t figure out how to attach it. Can you please tell me how to use the insert method correctly?
PS It is necessary that there be such a structure.
d456961b56584ab98146c75081abf7ba.PNG

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
OlegLazarenko, 2014-12-26
@OlegLazarenko

$domDocument->insertBefore($firstItem, $newItem);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question