Hello, Im trying to append an XML node to an XML file through a PHP form...but im running into some trouble. I need it to append to the beginning. Can anyone help me out? I am running php 4.3.9. Example - PHP Form: Input Field 1 - Topic Input Field 2 - Name Submit Button - process.php XML File: <contacts> <entry topic="NEW APPENDED NODE" name="NEW APPENDED NODE"> <entry topic="Science" name="Bob"> <entry topic="Politics" name="Tim"> </contacts> Any ideas? Thank you much! -Tim
Do you have the possibility of getting PHP 5? Using DOM would make your life SO much easier! Is that an option? Jay
If you want to press ahead, look up DOM. Or, if you want a quicker, perhaps easier, way, check explode and/or preg_replace. Jay