Home  >  Article  >  Backend Development  >  Introducing tutorials on quickly exporting Table data with PHP

Introducing tutorials on quickly exporting Table data with PHP

jacklove
jackloveOriginal
2018-06-08 11:53:401408browse

php quickly exports Table data. This function is available on some websites. This article will explain its related content.

//先获取某个数据
          $date = input();
          $id = @$date['data'];
         $dataResult=Db::table('demo')
             ->where('id','in',$id)
             ->select();
//        $dataResult = input('data');
//        $dataResult = json_decode($dataResult,true);
//        dump($dataResult);die;
        $headTitle = "XX数据";
        $title = date("Y-m-d")."-"."XX数据导出数据";
//        $headtitle = "{$headTitle}";
        $headtitle = "{$headTitle}";
        $titlename="
           编号
           XX标题
           姓名
           年龄
           性别
           XX号
           XX室
           XX区
           XX志
           XX时间
           XX操作
           XX备注
           XX修改
           XX时间
           XX类型
           XX标识
       ";
        $filename = $title.".xls";
//        dump($title);
        $this->excelData($dataResult,$titlename,$headtitle,$filename);
public function excelData($datas,$titlename,$title,$filename)
  {
      $str = "

This article introduces the relevant content of PHP to quickly export Table data. The function of exporting Table data is a common function on some websites. For more related content, please pay attention to the PHP Chinese website.

Related recommendations:

Explain how to use the PHP predefined interface ArrayAccess

Introduce PHP file naming, classes and Standards for naming methods, naming variables, etc.

How to solve the problem of garbled data queried by PHP

The above is the detailed content of Introducing tutorials on quickly exporting Table data with PHP. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn