Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I'm trying to create a simple XML file with a php script.Code: Select all
....
$masterlist_doc = new_xmldoc('1.0');
$root = $masterlist_doc ->add_root('review_list');
$j = 1;
while ($j < sizeof($reviewname))
{
$review = $root->new_child($itemname,'');
$review->new_child('RNam',$reviewernames[1]);
$j++;
echo $j;
}
$fp = @fopen($dir.'/../reviewers_list/Master_Review_List.xml','w');
if(!$fp) {
die('Error cannot create MasterReviewList XML file at '.$dir.'/reviewers_list/Master_Review_List.xml');
}
fwrite($fp,$masterlist_doc->dumpmem());
fclose($fp);This works, but its horrible for a human to read the results, as theres no cartridge returns anywhere, its all in one big block.
Is it possible to add a new line after each element? so it reads ok if viewed with even notepad?
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]