Heim > php教程 > php手册 > php excelreader2导出类读取函数详解

php excelreader2导出类读取函数详解

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Freigeben: 2016-06-21 08:53:44
Original
1459 Leute haben es durchsucht

  在学习完php jpgraph安装与使用教程后,我来介绍下php导出excel类php excelreader2.21,php excelreader2.21是一个专门用来导出(读取)excel文件内容的php导出excel类,学会使用php导出excel文件也会为今后统计数据时使用php jpgraph绘制图表打下基础。在php excel reader2.21导出excel中文乱码解决方法教程中我已简单介绍过php excelreader。为了将来学习使用php excelreader2.21导出excel文件内容时打下基础,我对php excelreader2.21类中导出excel文件需要用到的函数进行详细说明。

  php excel导出类 excelreader的公有函数主要分以下几个方面

  导出excel中单元格的各种值

1
2

function val($row,$col,$sheet=0)
function value($row,$col,$sheet=0)

  val函数与value函数说明:获取某个单元格内的值,如果没有则返回空值。
  row:数字形式
  col:数字或字符串形式,字符串不区分大小写

1
2

function type($row,$col,$sheet=0)
function raw($row,$col,$sheet=0)

  由于我对excel对象的具体属性不是完全了解使我还没完全吃透这两个函数是何意,也许在今后的php导入导出excel实例时会明白,如果你知道欢迎留言告诉我,谢谢。

  导出excel中单元格的各种属性

1
2
3

function rowspan($row,$col,$sheet=0)

function colspan($row,$col,$sheet=0)

  rowspan函数说明:确定某一单元格是否是行合并,如是则返回具体合并的行数,没合并则返回1
  colspan函数说明:确定某一单元格是否是列合并,如是则返回具体合并的列数,没合并则返回1

1

function hyperlink($row,$col,$sheet=0)

  hyperlink函数说明:确定某一单元格是超链,如是则返回具体链接地址,否则返回空值。注意:col参数必须是数字,不能是字符串形式,否则会返回空值

1
2
3
4
5
6
7
8
9
10
11

function rowcount($sheet=0)

function colcount($sheet=0)

function colwidth($col,$sheet=0)

function colhidden($col,$sheet=0)

function rowheight($row,$sheet=0)

function rowhidden($row,$sheet=0)

  rowcount函数说明:返回excel工作本总有有多少行
  colcount函数说明:返回excel工作本共有多少列
  colwidth函数说明:返回某一列的宽度,列参数必须是数字
  colhidden函数说明:确定某一列是否隐藏,是则返回1,否则返回空值,列参数必须是数字
  rowheight函数说明:返回某一行的高度
  rowhidden函数说明:确定某一行是否隐藏,是则返回1,否则返回空值
  
  导出excel中单元格的CSS属性

1

function style($row,$col,$sheet=0,$properties='')

  style函数说明:返回某个单元格的CCS属性

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

function align($row,$col,$sheet=0)

function bgColor($row,$col,$sheet=0)

function borderLeft($row,$col,$sheet=0)

function borderRight($row,$col,$sheet=0)

function borderTop($row,$col,$sheet=0)

function borderBottom($row,$col,$sheet=0)

function borderLeftColor($row,$col,$sheet=0)

function borderRightColor($row,$col,$sheet=0)

function borderTopColor($row,$col,$sheet=0)

function borderBottomColor($row,$col,$sheet=0)

  align函数说明:返回指定单元格的对齐属性,比如left、right、center等
  bgcolor函数说明:以数值形式返回某个单元格的背景颜色,单元格必须有颜色,否则返回空值
  borderLeft函数说明:以字符串形式返回borderleft的类型,注意单元格必须是具有borderleft属性,否则返回空值。与之类似的函数有borderRight,borderTop,borderBottom
  borderLeftColor函数说明:以#开头的4位十六进制返回borderleft的color值,比如#FF0000。与之类似的函数有borderRightColor,borderTopColor,borderBottomColor

  导出excel中单元格字体属性

1

function color($row,$col,$sheet=0)

  color函数说明:返回某个单元格中字体的颜色,以字符串形式返回,比如red

1
2
3

function bold($row,$col,$sheet=0)
function italic($row,$col,$sheet=0)
function underline($row,$col,$sheet=0)

  bold函数说明:返回某个单元格中的字体是否为粗体,是则返回1
  italic函数说明:返回某个单元格中的字体是否为斜体,是则返回1
  underline函数说明:返回某个单元格中的字体是否为下划线,是则返回1

1
2

function height($row,$col,$sheet=0)
function font($row,$col,$sheet=0)

  height函数说明:返回某个单元格中的字体大小
  font函数说明:返回某个单元格中的字体的名称

  至此,php导出excel类excelreader2.21中读取excel文件内容的公有函数说明就介绍完了,只要了解和掌握这些函数的运用,使用php excelreader2.21导出excel内容非常简单,也为将excel内容导入mysql数据库提供了桥梁。

  :PHP网站开发教程-leapsoul.cn版权所有,转载时请以链接形式注明原始出处及本声明,谢谢。



Verwandte Etiketten:
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Empfehlungen
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage