Giter VIP home page Giter VIP logo

myexcel's Introduction

依赖:

  • phpexcel 1.8

使用方法:

//1.实例化
/* 
 $file 要导入的.xlsx 文件,默认为false,当只使用write方法的时候不需要传参
 $index 默认为0,可传入sheet的索引值,或者名字
*/
$my=new \tansuo1989\myexcel($file,$index);

//2.get_data
$my->get_data($row1=false,$row2=false,$col1=false,$col2=false);
/* 
  $row1,$row2 开始和结束的行数
  $col1,$col2 开始和结束的列名
  也可以传两个参数("A:1","D:60"),即从第一行A到第60行的D
  不传参的话,获取所有
*/

//3.get_row 或 get_col 获取指定行或指定列

$data=$my->get_row(5,"A","E");
$data=$my->get_col("D",2,10);

//4.write 往excel文件中写入数据,并保存为 filename.xlsx 文件
/* 
$data=array(
    array(),  //第一行
    array(),  //第二行
);
$data 必须是个二维数组
*/
$my->write($data,"filename");

myexcel's People

Contributors

tansuo1989 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.