PHP生成EXCEL,可区分数值与字符串
这是个在别人的基础上做修改的代码,添加了 判断单元格值是否为数值,是的话,将该单元格的类型转成 Number,避免生产的EXCEL中没法进行数值的加减。。。
<?php
/**
* Simple excel generating from PHP5
*
* This is one of my utility-classes.
*
* The MIT License
*
* Copyright (c) 2007 Oliver Schwarz
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* from, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* @package Utilities
* @author Oliver Schwarz <oliver.schwarz@gmail.com>
* @version 1.0
*/
/**
* Generating excel documents on-the-fly from PHP5
*
* Uses the excel XML-specification to generate a native
* XML document, readable/processable by excel.
*
* @package Utilities
* @subpackage Excel
* @author Oliver Schwarz <oliver.schwarz@vaicon.de>
* @version 1.0
*
* @todo Add error handling (array corruption etc.)
* @todo Write a wrapper method to do everything on-the-fly
*/
class MyClass_ExcelXML
{
/**
相关文档:
<?php
$host="192.168.1.214";
$post=21;
$username="zwc3g";
$password="zwc3ggg";
$ftp=ftp_connect($host,$post);
ftp_login($ftp,$username,$password);
displayTheFolder($ftp,"/zhulu2");
//打印FTP上的该目录下的所有文件。
fu ......
中国第一档绿色PHP资源分享门户,专注于创新和原创类源码php资源,原创视频php资源,原创典型模块php资源,原创php开源资源,原创php教程资源,原创网站模板资源 。网站地址 http://www.phpzy.com/
绿色php资源 ......
Show All 1 2 3 4 5
本文由Michael原创和整理,转载请保留出处!http://www.toplee.com/blog/?p=100
Trackback URL: http://www.toplee.com/blog/wp-trackback.php?p=100
对于本文中出现的错误导致您的损失,Michael不承担责任。
前一段时间完成了服务器从FreeBSD4.10到6.1的升级,同时把PHP也升级到了最新的 ......
其实这篇文章也不能算作是原创,只是在原作者的基础上修改的比较多,几乎重写了一遍。
<?php
/**
*在原作者的基础上修改的,呵呵,不过忘记了原作者是谁了,
*如果原作者看到的话,给我一个提示,o(∩_∩)o...
*我的blog:http://etongchina.blogcn.com
*我的邮箱:etongchina@gmail.com
**/
fu ......
1:smarty 缓存的配置
Php代码
$smarty->cache_dir = "/caches/"; //缓存目录
$smarty->caching = true; //开启缓存,为flase的时侯缓存无效
$smarty->cache_lifetime = 60; //缓存时间
2:smarty缓存的使用和清除
Php代码
$smarty->di ......