I\'m trying to write a script that will update an RSS XML file. I want it to take the existing file and add a new item to the top of the items list. I\'ve previous gotten it to
I got it working. I changed these lines:
$firstItem = $items->item(0); $firstItem->insertBefore($newItem,$firstItem->firstChild);
To this line:
$items->item(0)->parentNode->insertBefore($newItem,$items->item(0));