comma in the wrong place
<p>I have this issue i am writing a array to a file but when i unset() some sub arrays it keeps the comma or when i add anther sub array to the end it add a comma.</p>

<p>eg:</p>

<pre><code>$account_data = include('./*****/AccountData.php');

$account_data[$username]['Name']     = $name;
$account_data[$username]['Password'] = $password;
$account_data[$username]['RandID']   = $randid;
$account_data[$username]['PublicD']  = $publicdownload;
$account_data[$username]['Enabled']  = $enabled;
$account_data[$username]['Admin']    = $admin;

$configdata = "&lt;?php\n\nreturn ".var_export($account_data, true)."; \n\n?&gt;";

$file = fopen('./*****/AccountDataTest.php', 'w');
fwrite($file, $configdata);
fclose($file);
</code></pre>

<p>when i run that code to add a sun array i get this</p>

<pre><code>&lt;?php
return array (
    'Ryan' =&gt; array (
        'Name' =&gt; 'Ryan',
        'Password' =&gt; '',
        'RandID' =&gt; '',
        'PublicD' =&gt; 0,
        'Enabled' =&gt; 1,
        'Admin' =&gt; 0,
    ),
    'Chris' =&gt; array (
        'Name' =&gt; 'Christopher',
        'Password' =&gt; '',
        'RandID' =&gt; '',
        'PublicD' =&gt; 1,
        'Enabled' =&gt; 1,
        'Admin' =&gt; 1,
    ),
);
?&gt;
</code></pre>

<p>as you can see it adds a comma and when i run my unset function the code for the AccountData.php file will look the same with out the Chris but it has the following comma at the end of Ryan.</p>

<p>I am not sure how I can fix this I have been googling with not much luck.</p>
