php读取execel文档

php读取execel文档

?php$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);?table width=100% border=0
cellpadding=0 cellspacing=1 bgcolor=#CCCCCC tr td align=centerID/td td
align=centerUNM/td td align=centerEMAIL/td td align=centerQQ/td td
height=25 align=centerPhone/td td align=centerOther/td /tr
?phpwhile(!$rs-eof()){ ? tr td align=center
bgcolor=#FFFFFF?=$rs[ID]?/td td align=center
bgcolor=#FFFFFF?=$rs[unm]?/td td align=center
bgcolor=#FFFFFF?=$rs[email]澳门新葡亰手机版,?/td td align=center
bgcolor=#FFFFFF?=$rs[qq]?/td td height=25 align=center
bgcolor=#FFFFFF?=$rs[phone]?/td td align=center
bgcolor=#FFFFFF?=$rs[other]?/td /tr ?php $rs-movenext; } ?/table