title: Php fputcsv trouble to Col
body: <p>I get name and data from html. I want write it in to CSV.</p>
  
  <p>So I get this CSV.</p>
  
  <pre><code> ColA    ColB         ColC   ColD   ColE   ColF   ColG
   name1   surname1     data1  data2   data3 data4 data5
   name2   surname2     data6  data7   data8 data9 data10
   name3   surname3     data11 data12  data13 data14 data15
   name..n surname..n data..n data..n  data..n data..n data..n
  </code></pre>
  
  <p>But I want name and surname in ColA.</p>
  
  <pre><code>     ColA           ColB   ColC   ColD   ColE   ColF  
   name1 surname1     data1  data2   data3 data4 data5
   name2 surname2     data6  data7   data8 data9 data10
   name3 surname3     data11 data12  data13 data14 data15
   name..n surname..n data..n data..n  data..n data..n data..n
  </code></pre>
  
  <p>I think because "space" 's  name and surname (some have mid name) but Data not have a space. I want write name and surname in ColA. Plzzz help me. T-T</p>
  
  <pre><code> $fp = fopen("data.csv","w");
     $string = '';
      for ($i=0; $i&lt;$count_name; $i++)
  {
  while ( $iterate &lt;= 5 and $j &lt; $count_data )
  {
      $string = $string.$temp_data[$j]." ";
      $j++;
      $iterate++;
  }
  $csv_string = $temp_name[$i]." ".$string;
  //echo $temp_name[$i];
  $array = explode(' ',$csv_string);
  //var_dump($array);
  fputcsv($fp,$array);
  //$string = "";
  $iterate = 1;
  $string = "";
  
  }
  </code></pre>