How can I do this with a loop so I dont have to do it manually for array data[]
<p>How can I do this as a loop, so I don't have to do it manually for each element of the array?     </p>

<pre><code> $filename=$_POST['filename'];
 $handle = fopen("$filename", "r");
 while (($data = fgetcsv($handle, 5000, ",")) !== FALSE)
 {  
    $data[0] = mysql_escape_string($data[0]);   /// customer id
    $data[1] = mysql_escape_string($data[1]);   /// first name
    $data[2] = mysql_escape_string($data[2]);   /// last name
    $data[3] = mysql_escape_string($data[3]);   /// email
    $data[4] = mysql_escape_string($data[4]);   /// phone
    $data[5] = mysql_escape_string($data[5]);   /// mobile
    $data[6] = mysql_escape_string($data[6]);   /// website
    $data[7] = mysql_escape_string($data[7]);   /// DOB
    $data[8] = mysql_escape_string($data[8]);   /// spouse first name
    $data[9] = mysql_escape_string($data[9]);   /// spouse last name
    $data[10] = mysql_escape_string($data[10]); /// spouse cell
    $data[11] = mysql_escape_string($data[11]);  /// spouse email
    $data[12] = mysql_escape_string($data[12]);  //// created by
    $data[13] = mysql_escape_string($data[13]);  //// created on
}
</code></pre>
