Editing csv files through PHP
<p>I am making a quiz on a webpage for my media class. I am new to programming.  I need to learn how to edit my data csv file to make it more useful. Currently, when I look at my csv file, I only get four columns of numbers (the results of the quiz). I need to add two columns, one that includes a timestamp and one that shows the IP address of the person that filled out the quiz.</p>

<p>Part of My PHP looks like this:</p>

<pre><code>    $csv_filehandle = fopen("/var/www/html/data/quiz.csv",'a');
    fputcsv($csv_filehandle,array($summer,$spring,$fall,$winter));
    fclose ($csv_filehandle);

    $visit_id = uniqid('',TRUE);

    $all_my_variables = array(
        'timestamp' =&gt; $current_timestamp,
        'user_ip' =&gt; $_SERVER['REMOTE_ADDR'],
        'summer' =&gt; $summer,
        'spring' =&gt; $spring,
        'fall' =&gt; $fall,
        'winter' =&gt; $winter,
    );

    $json_filehandle = fopen("/var/www/html/data/$visit_id.json",'w');
    fwrite($json_filehandle,json_encode($all_my_variables));
    fclose($json_filehandle);




    $current_hour = date_default_timezone_set("America/Chicago");
    $current_timestamp = date(DATE_RFC822);
</code></pre>

<p>Where/how do I add these columns so that they show up on my csv file?
Help would be greatly appreciated!</p>
