Introducing tutorials on quickly exporting Table data with PHP

jacklove
Release: 2023-03-30 18:12:01
Original
1384 people have browsed it

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);
Copy after login
public function excelData($datas,$titlename,$title,$filename)
  {
      $str = "
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!