国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Home PHP Libraries Other libraries PHP class to export excel table
PHP class to export excel table
<?php
  public function setEncode($incode,$outcode){
    $this->inEncode=$incode;
    $this->outEncode=$outcode;
  }
  public function setTitle($titlearr){
    $title="";
    foreach($titlearr as $v){
      if($this->inEncode!=$this->outEncode){
        $title.=iconv($this->inEncode,$this->outEncode,$v)."\t";
      }
      else{
        $title.=$v."\t";
      }
    }
    $title.="\n";
    return $title;
  }

Usage method

$excel=new Excel();

Set encoding:

$excel->setEncode("utf-8" ,"gb2312"); //If you don't want to transcode, just write the same parameters, for example $excel->setEncode("utf-8","utf-8");

settings Title bar

$titlearr=array("a","b","c","d");

Set content bar

$contentarr=array(

1=>array("ab","ac","ad","ae"),

2=>array( "abc","acc","adc","aec"),

3=>array("abd","acd","add","aed"),

4=>array("abe","ace","ade","aee"),

);

$excel->getExcel($titlearr,$ contentarr,"abc");


Disclaimer

All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn

Related Article

How to export database table data to Excel file using PHPMyAdmin How to export database table data to Excel file using PHPMyAdmin

19 May 2025

Use PHPMyAdmin to easily export database table data to Excel files. The specific steps are as follows: 1. Open PHPMyAdmin and select database and tables. 2. Click the "Export" option, select Excel format and click "Execute" to download the file. Note that during the export process, challenges such as large data volume, data format adjustment, encoding problems and data type conversion may be required. The export process can be optimized by batch export, customizing the format, ensuring consistent encoding and preprocessing data.

How to Export MySQL Data to Separate Excel Cells using PHP? How to Export MySQL Data to Separate Excel Cells using PHP?

25 Nov 2024

Retrieving MySQL Data in Separate Excel Cells using PHPYour original PHP script combines all text values into a single Excel cell, conflicting...

How Do I Link Static Libraries That Depend on Other Static Libraries? How Do I Link Static Libraries That Depend on Other Static Libraries?

13 Dec 2024

Linking Static Libraries to Other Static Libraries: A Comprehensive ApproachStatic libraries provide a convenient mechanism to package reusable...

How to export Excel file and set column width in native PHP? How to export Excel file and set column width in native PHP?

31 Mar 2025

When exporting Excel files using native PHP, you often encounter the problem of how to set the column width. This article will focus on "How to export Excel files in native PHP and...

How can I export MySQL data to Excel using PHP and ensure proper cell distribution? How can I export MySQL data to Excel using PHP and ensure proper cell distribution?

25 Nov 2024

Exporting MySQL Data to Excel in PHPWhen exporting MySQL data to Excel, it's crucial to ensure that the data is properly distributed across...

How to Silence TensorFlow\'s Debugging Output? How to Silence TensorFlow\'s Debugging Output?

28 Oct 2024

Suppression of Tensorflow Debugging OutputTensorflow prints extensive information about loaded libraries, found devices, and other debugging data...

See all articles