php生成EXCEL的东东

可以通过PHP来产生EXCEL档. teaman翻译
  ----------------------------
  Excel Functions
  ----------------------------
  将下面的代码存为excel.php ,然后在页面中包括进来
  
  然后调用
  1. Call xlsBOF()
  2. 将一些内容写入到xlswritenunber() 或者 xlswritelabel()中.
  3.然后调用 Call xlsEOF()
  
  也可以用 fwrite 函数直接写到服务器上,而不是用echo 仅仅在浏览器上显示
  
  
   数据挖掘实验室
  
  // ----- begin of function library -----
  // Excel begin of file header
  function xlsBOF() {
   echo pack("ssssss", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);
   return;
  }
  // Excel end of file footer
  function xlsEOF() {
   echo pack("ss", 0x0A, 0x00);
   return;
  }
  // Function to write a Number (double) into Row, Col
  function xlsWriteNumber($Row, $Col, $Value) {
   echo pack("sssss", 0x203, 14, $Row, $Col, 0x0);
   echo pack("d", $Value);
   return;
  } 数据挖掘工具
  // Function to write a label (text) into Row, Col
  function xlsWriteLabel($Row, $Col, $Value ) {
   $L = strlen($Value);
   echo pack("ssssss", 0x204, 8 + $L, $Row, $Col, 0x0, $L);
   echo $Value;
  return;
  }
  // ----- end of function library -----
  ?>
  
  //
  // To display the contents directly in a MIME compatible browser
  // add the following lines on TOP of your PHP file:
  
  
  header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
  header ("Last-Modified: " . gmdate("D,d M YH:i:s") . " GMT"); 数据挖掘实验室
  header ("Cache-Control: no-cache, must-revalidate");
  header ("Pragma: no-cache");
  header ("Content-type: application/x-msexcel");
  header ("Content-Disposition: attachment; filename=EmplList.xls" );
  header ("Content-Description: PHP/INTERBASE Generated Data" );
  //
  // the next lines demonstrate the generation of the Excel stream
  //
  xlsBOF(); // begin Excel stream
  xlsWriteLabel(0,0,"This is a label"); // write a label in A1, use for dates too
  xlsWriteNumber(0,1,9999); // write a number B1
  xlsEOF(); // close the stream
  ?>
[数据挖掘专家] [数据挖掘研究院] [数据挖掘论坛] [数据挖掘实验室]
上一篇:使用无限生命期Session的方法
下一篇:用PHP实现多级树型菜单
最新评论共有 0 位网友发表了评论 , 查看所有评论
发表评论( 不能超过250字,需审核,请自觉遵守互联网相关政策法规。 )
匿名?
数据挖掘网站导航 数据挖掘论坛导航
  • 数据挖掘工具
  • 数据挖掘论坛
  • DataCruncher - Cognos
  • MineSet - MathSoft
  • Intelligent Miner - GainSmarts
  • Sqlserver - SAS - Clementine
  • CART - Weka - WizSoft
  • NeuroShell - ModelQuest
  • data mining tools - Darwin
  • 数据挖掘交友
  • 数据挖掘博客
  • 数据挖掘工具
  • 数据挖掘资源
  • 数据挖掘技术算法
  • 数据挖掘相关期刊、会议
  • 研究院联盟合作专区
  • 数据挖掘基础与相关技术
  • 数据挖掘厂商与就业
  • 数据挖掘研究者乐园
  • 知名厂商数据挖掘工具资料
  • 国内数据挖掘实验室
  • Foreign Data Mining Lab
  • 热点关注
  • P2P Search Engines-Napster
  • Peer to Peer ( P2P ) 综述
  • P2P Search Engines-Introduction
  • P2P Routing
  • P2P Search Engines-Music and P2P
  • P2P Search Engines-Historical Developmen
  • P2P Security
  • 如何从一个php文件向另一个地址post数据,
  • 基于PHP的AJAX技术实现文件异步上传
  • Copyright and P2P
  • 论坛最新话题
  • Foundations of Statistical Natural Langu
  • Game Theory meet Data Mining: A Recent P
  • System Building: How does it help or hin
  • 数据挖掘与Clementine培训
  • 新手报到
  • 求 SASEM 客户流失预测分析
  • 数据挖掘工程师/搜索研究院—北京——无线
  • 数据挖掘入门介绍(如何着手数据挖掘)
  • Information Overload Survey Results
  • The INEX 2005 Workshop on Element Retrie
  • 相关资讯
  • P2P Search Engines-Introduction
  • P2P Search Engines-Music and P2P
  • P2P Search Engines-Historical Developmen
  • Copyright and P2P
  • P2P Search Engines-Napster
  • GNUtella
  • YouServ ?An Analysis
  • Freenet
  • P2P Search Engines
  • P2P Routing
  • 数据挖掘实验室资料
  • 数据挖掘博客地址
  • 数据挖掘实验室网站地址
  • Prepare for Medicare audits by using dat
  • 注册成为SAS用户与爱好者俱乐部会员
  • 水南梅
  • 明日烟
  • 新人报道
  • 下载
  • 厦门服务器托管,450元/月—0592-5177319 高
  • 买空间送域名--0592-5177319 高静