How to add more element with PHP XMLWriter? -


my code:

$writer = new xmlwriter(); $writer->openuri('data.xml'); $writer->startdocument('1.0','utf-8');   $writer->startelement("cont"); $writer->writeelement('product', $produto);   $writer->writeelement('price', $preco);  $writer->enddocument(); $writer->flush(); 

output:

product: cd price: 10,00 

how add element without deleting last element?

i want xml return.

product: cd2 price: 20,00 product: cd price: 10,00 product... 


Comments

Popular posts from this blog

html - How to custom Bootstrap grid height? -

javascript - pass values from mssql to views in node -

ruby - unknown property method: 'wait' on EC2 windows server Instance -