⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 excelgen_example.php

📁 export data to excel
💻 PHP
字号:
<?php
	
	/* 
	 * @version V1.0 2002/July/18 (c) Erh-Wen,Kuo (erhwenkuo@yahoo.com). All rights reserved.
	 * Released under both BSD license and Lesser GPL library license. 
	 * Whenever there is any discrepancy between the two licenses, 
	 * the BSD license will take precedence. 
	 *
	 * purpose: This is a example how to use "ExcelGen" class to write number or text
	 *          to excel file format and stream the output to user's browser directly.
	 */
	
	//include "excelgen" class
	include( "excelgen.class.php" );
	
	//initiate a instance of "excelgen" class
	$excel = new ExcelGen("ExcelGen");
	
	//initiate $row,$col variables
	$row=0;
	$col=0;
	
	//write text in cell(0,0)
	$excel->WriteText($row,$col,"This is a ExcelGen Clas Example");
	$row++;
	
	//write number in cell($row,$col)	
	for($row;$row<9;$row++){
		for($col=0;$col<9;$col++){
			$excel->WriteNumber($row,$col,$row*$col);
		}
	}
	
	//stream Excel for user to download or show on browser
	$excel->SendFile();
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -