I am creating an xml file with PHP, here is a sample code.
$myFile = "example_file.xml"; $fh = fopen($myFile, 'w'); while($row = mysql_fetch_array($result)) { $stringData = "<field name=\"id\">$page_id</field> <field name=\"url\">http://myfundi.co.za/a/$page_url</field> <field name=\"title\">$pagetitle</field> <field name=\"content\">$bodytext</field> <field name=\"site\">Myfundi</field>"; fwrite($fh, $stringData); } fclose($fh);
I need to do when the first text is written to a text file, I need to add and add more text.
I need to add and add to existing data.
How can i do this?
thanks
source share