求用PHP将MySQL数据表转换为Excel表的方法! http://pear.php.net/package/Spreadsheet_Excel_Writer自己写脚本哦还有phpMyAdmin2.6.x也能直接导出数据到Excel的很方便 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 phpMyAdmin能导出MS Excel 的 CSV 格式 谢谢!phpMyAdmin确实可以。不过我想实现的是把符合条件的搜索结果导出来,而不是导出整个表。搜索的功能我已经实现了,就差导出的功能了。那个Spreadsheet Excel Writer不知道怎么用,能不能解释一下? phpMyAdmin也可以按搜索条件导出,我看到了。可是到phpMyAdmin里面操作还是不太方便。 直接将程序产生的html表格写到后缀为xls的文件里就可以了 下载解压以后应该放到哪个目录?我放在网页目录下运行writer.php出错,我从来没有用过pear,不知道应该如何配置? 我写了一个类 class Cexcel { var $fileName; function Cexcel($file) { if($file!='') { $this->fileName=$file; } } function Downxls() { header("Content-type: application/vnd.ms-excel"); header("Content-Length: ".filesize("./".$this->fileName."")); header("Content-Disposition: attachment; filename=./".$this->fileName.""); if(file_exists("./".$this->fileName."")) readfile("./".$this->fileName.""); exit(0); } function xlsBOF() { return pack("ssssss", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); } function xlsEOF() { return pack("ss", 0x0A, 0x00); } function xlsWriteNumber($Row, $Col, $Value) { $result=pack("sssss", 0x203, 14, $Row, $Col, 0x0); $result.=pack("d", $Value); return $result; } function xlsWriteLabel($Row, $Col, $Value ) { $L = strlen($Value); $result=pack("ssssss", 0x204, 8 + $L, $Row, $Col, 0x0, $L); $result.=$Value; return $result; } } 调用方法,就按下面顺序可以了了xlsBOF() xlsWriteLabelxlsWriteNumberxlsBOF() Downxls() 正则如何匹配<b>和</b>可能存在或可能不存在? 请问各大侠,如何在PHP中获取Input 的值! 请大家介绍几款免费给PHP加密的工具。无时间限制的那种 phpQuery 数据抓取疑问 版主请回答。。。信誉分为什么减了5分 [求救啊!!]想知,在哪设上传文件大小的啊? jsp asp php 那一个更好? 什么叫触发机制?如何触发? 哪位大侠有在局域网用的搜索引擎?? mybaties环境搭建步骤 地址栏里网址前边会有一个小图片,请问怎么添加这个图片 研究一个问题,顶者有分(100分,不够另开帖散分):PHP5 JAVA整合的配置方法.
class Cexcel
{
var $fileName;
function Cexcel($file)
{
if($file!='')
{
$this->fileName=$file;
}
}
function Downxls() {
header("Content-type: application/vnd.ms-excel");
header("Content-Length: ".filesize("./".$this->fileName.""));
header("Content-Disposition: attachment; filename=./".$this->fileName."");
if(file_exists("./".$this->fileName.""))
readfile("./".$this->fileName."");
exit(0);
}
function xlsBOF() {
return pack("ssssss", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);
}
function xlsEOF() {
return pack("ss", 0x0A, 0x00);
}
function xlsWriteNumber($Row, $Col, $Value) {
$result=pack("sssss", 0x203, 14, $Row, $Col, 0x0);
$result.=pack("d", $Value);
return $result;
}
function xlsWriteLabel($Row, $Col, $Value ) {
$L = strlen($Value);
$result=pack("ssssss", 0x204, 8 + $L, $Row, $Col, 0x0, $L);
$result.=$Value;
return $result;
}
}
xlsBOF()
xlsWriteLabel
xlsWriteNumber
xlsBOF()
Downxls()