Php writing to a file / string formating / file format how to do it right?
<p>right now I'm doing it this way:</p>

<pre><code>$myFile = "config.ini";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = "[scripts]\n\n[admin]\nhide_fields[] = ctr_ad_headerImg\n\n";
fwrite($fh, $stringData);
$stringData = "[widget_areas]\n0.name = \"Top Navigation\"\n0.id = top-nav\n0.description = \"Widget area at the very top of the page\"\n\n[default_colors]\nsitebg = #$sitebg\nfooterbg = #$footerbg\nlink = #$link\nurl = #$url\nbg = #$bg\ntext = #$text\nborder = #$border\n\nlu_link = #$lu_link\nlu_url = #$lu_url\nlu_bg = #$lu_bg\nlu_text = #$lu_text\nlu_border = #$lu_border";
fwrite($fh, $stringData);
fclose($fh);
</code></pre>

<p>The problem here is that I have to keep that exact file structure, what is a better way to do this? What should I study ? Any tutorials? Thanks</p>
