Excel split cell Phpexcel methods for merging and splitting cells

Source: Internet
Author: User
Tags php regular expression
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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.