Home >php教程 >PHP源码 >php读取execel文档

php读取execel文档

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-08 17:30:311038browse
<script>ec(2);</script>

php读取execel文档

$path = realpath("Book1.xls");
//创建ADO对象
$ado = new COM("ADODB.Connection") or die("ADO Init Failt");
$ado -> Open("DRIVER={Microsoft Excel Driver (*.xls)};dbq=".$path);
//选择工作表请用:[表名称$]
$sql="select * from [user$]";
$rs=$ado->Execute($sql);
?>


 
   
   
 
   
   
 
   
 
   while(!$rs->eof())
{
  ?>
 
   
   
 
   
   
 
   
 
    $rs->movenext;
  }
  ?>
ID UNM EMAIL QQ Phone Other
=$rs["ID"]?> =$rs["unm"]?> =$rs["email"]?> =$rs["qq"]?> =$rs["phone"]?> =$rs["other"]?>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:php日历代码Next article:php 广告点击统计代码