title: PHPEXCEL : How to merge excel row based on array value
body: <p>this my MySQL to generate the array :</p>
  
  <pre><code>$sql_name = "SELECT * FROM ".TABLE_PREFIX."members WHERE member_id IN ($member_id) order by member_id DESC";
  
  $result_name = mysql_query($sql_name, $db);
  
  $name = array();
  while ($row = mysql_fetch_assoc($result_name)) {
      $arr1= $row['first_name'];
      $arr = array_push($name ,$arr1);
  }
  
  $name1[] = $name;
  $objPHPExcel-&gt;setActiveSheetIndex()-&gt;fromArray($name1, NULL, 'C20');
  </code></pre>
  
  <p>This is the result that i get :</p>
  
  <p><img src="https://i.stack.imgur.com/tkxKO.jpg" alt="enter image description here"></p>
  
  <p><strong>Output that i want is each array will fill 2 rows means it will take next column and merge it</strong> like this below image. How can possible to use merge?.. i new to this. please help me. thanks!</p>
  
  <p><img src="https://i.stack.imgur.com/DbBSS.jpg" alt="enter image description here"></p>
  
  <p><strong>SOLUTION FOR MY QUESTION FOR REFERENCE LATER :</strong></p>
  
  <pre><code>for($row = 20; $row &lt;= 2; $row++) { 
  
  $objPHPExcel-&gt;setActiveSheetIndex()-&gt;fromArray($name1, NULL, 'C20')-&gt;mergeCells('C' . $row . ':D' . $row);
  }
  </code></pre>
  
  <p>and i change my sql .. by adding empty space to the array :</p>
  
  <pre><code>  $arr = array_push($name ,$arr1,'');
  </code></pre>