PHP读取excel文件的源代码类 不指定

shuguang , 22:10 , 代码片段 , 评论(1) , 引用(0) , 阅读(1391) , Via 本站原创 | |
注域名、买空间、建网站、租机器、购邮箱找中国数据
请下载附件中的源码,不要直接复制 (已下载 362 次)


------------------------------------------
Excel 类  V1.1
        By Monkey
------------------------------------------
-----函数说明
读取Excel文件
function Read_Excel_File($ExcelFile,$Result)

$ExcelFile  Excel文件名
$Result    返回的结果

//oSPHP.COM.CN


函数返回值  正常返回0,否则返回错误信息

返回的值数组
  $result[sheet名][行][列] 的值为相应Excel Cell的值
  
建立Excel文件  
function Create_Excel_File($ExcelFile,$Data)

$ExcelFile  Excel文件名
$Data    Excel表格数据
请把函数写在PHP脚本的开头



例1:
<?
require "excel_class.php";

Read_Excel_File("Book1.xls",$return);

for (
$i=0;$i<count($return[Sheet1]);$i++) //OsPHP.COM.CN
{
  for (
$j=0;$j<count($return[Sheet1][$i]);$j++)
  {
    echo 
$return[Sheet1][$i][$j]."&#124;";
//OSPHP.COm.CN

  }
  echo 
"<br>";
}
?>

例2:
<?
require "excel_class.php";

Read_Excel_File("Book1.xls",$return);
Create_Excel_File("ddd.xls",$return[Sheet1]);
?>
//OsPHP.COM.CN


收藏本文到网摘: 添加到“Google书签” 添加到“Yahoo收藏” 添加到“QQ书签” 搜狐网摘 添加到“百度搜藏” 添加到“新浪ViVi收藏夹” 添加到“Del.icio.us” 添加到“365天天网摘” 添加到“天极网摘” 我摘·网摘·网络书签 添加到“POCO网摘” YouNote网摘 添加到“和讯网摘” 添加到“Bolaa博客收录中心” 添加到“igooi网摘” 添加到“天下图摘”
  • 中查看更多“PHP读取excel文件的源代码类”相关内容
  • 中查看更多“PHP读取excel文件的源代码类”相关内容
  • 中查看更多“PHP读取excel文件的源代码类”相关内容
  • 中查看更多“PHP读取excel文件的源代码类”相关内容
  • 中查看更多“PHP读取excel文件的源代码类”相关内容
  • 中查看更多“PHP读取excel文件的源代码类”相关内容
  • 中查看更多“PHP读取excel文件的源代码类”相关内容
  • 中查看更多“PHP读取excel文件的源代码类”相关内容


  • 最后编辑: shuguang 编辑于2008/10/23 17:53
    Tags: , , , , ,
    2008/10/23 11:56
    什么也没有????
    shuguang 回复于 2008/10/23 17:54
    不好意思,已经修复了
    分页: 1/1 第一页 1 最后页
    发表评论
    表情
    emotemotemotemotemot
    emotemotemotemotemot
    emotemotemotemotemot
    emotemotemotemotemot
    emotemotemotemotemot
    打开HTML
    打开UBB
    打开表情
    隐藏
    记住我
    昵称   密码   游客无需密码
    网址   电邮   [注册]