* Thus wrote Jay Blanchard ([EMAIL PROTECTED]): > A couple of things occured to me, but I am not sure that they're > desirable... > > With </root> being the last tag (does it occupy its own line?) you could > (pseudo-code, not tested and certain to be incomplete)... > > while(!feof($theXMLLogFile)){ > $theXMLLine = fgets($theXMLLogFile, 255); > if($theXMLLine == "</root>"){ > $theNewLogLine = "stuff you need to write \n </root>"; > ereg_replace("</root>", "$theNewLogLine", > $theXMLLogFile); > } > }
A little quicker: fseek($fh, -(strlen("</root>")), SEEK_END); fwrite($fh, $yourdata); fwrite($fh, "\n</root>"); Curt -- "I used to think I was indecisive, but now I'm not so sure." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php