here is my code, i am trying to acheive this.... <? $openingEntry = '<entry '; $numberAtt = ' number='; $nameAtt = ' name='; $dateAtt = ' date='; $messageAtt = ' message='; $linkAtt = ' link='; $closingEntry = "\"/>"; $Entry= $openingEntry."$numberAtt"."$myNumber".$nameAtt."$myName".$dateAtt."$myDate" .$messageAtt."$myMessage".$linkAtt."$myLink".$closingEntry; $fileName = "news.xml"; if ($fp = fopen ($fileName, "a+")){ $contents = fread ($fp, filesize ($fileName)); $temp = substr($contents,6); $newContents = "<news>" . $Entry . $temp; print "$newContents"; fwrite($fp,$newContents); fclose($fp); echo "done = true"; } else { echo "done = false"; } ?> i have an xml file with the following,
<news> <entry number = "0" name = "name" date = "date" message = "message" link = "link"/> </news> I want to add an entry like this: <news> <entry number = "1" name = "name" date = "date" message = "message" link = "link"/> <entry number = "0" name = "name" date = "date" message = "message" link = "link"/> </news> any ideas? i think i am ont he right track, short of splitting the contents into arrays.....Id rather deal with it in strings.... help? thanx travis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]