The example in this paper describes the method of Phpexcel merging and splitting cells. Share to everyone for your reference, as follows:
$objPHPExcel; $filepath = "c:\temp.xlsx"; try { $objReader = phpexcel_iofactory::createreader (' Excel2007 '); $objPHPExcel = $objReader->load ($filepath);} catch (Exception $e) {die ();} $column _index = "A";//empties the first row of cell values to be merged to fill the merged cell Value $objphpexcel->getactivesheet ()->setcellvalue ($column _index. $beginRow, ");//merge cells with a value of ' $objPHPExcel->getactivesheet ()->mergecells ($column _index. $beginRow. ":". $column _index. $ENDROW),//Split cell, empties the value of the pre-merged cell and restores the style of the pre-merged cell $objphpexcel->getactivesheet ()->unmergecells ($column _index. $beginRow. ":". $column _index. $ENDROW);
Reference:
Merge cells in Phpexcel
Phpexcel:how to Merge Cells
More readers interested in PHP related content can view this site topic: "PHP Operations Office Document Skills Summary (including word,excel,access,ppt)", "PHP array" operation Skills Daquan, "PHP Sorting algorithm Summary", " PHP common traversal algorithm and skills summary, "PHP Data structure and algorithm tutorial", "PHP Programming Algorithm Summary", "PHP Math Skills Summary", "PHP Regular Expression Usage summary", "PHP operation and operator Usage Summary", "PHP String Usage Summary" and "PHP Common database Operation Skills Summary"
I hope this article is helpful to you in PHP programming.
The above describes the Excel split cell phpexcel merge and split cells, including the Excel split cell content, I hope the PHP tutorial interested in a friend helpful.