国产美女爆乳呻吟视频,日韩精品一区二区三区久久,国产午夜福利短视频 http://www.86956464.com/blog 中山php|最優(yōu)網(wǎng)絡(luò) Mon, 13 May 2013 04:56:43 +0000 en hourly 1 http://wordpress.org/?v=3.1.4 php生成excel或者word文檔最簡單的方法 http://www.86956464.com/blog/view-287.html http://www.86956464.com/blog/view-287.html#comments Thu, 29 Sep 2011 08:29:51 +0000 lin http://www.86956464.com/blog/?p=287 以下代碼實現(xiàn)簡單輸出表格或者word文檔,如生成一個兩列的excel文檔,改動相應(yīng)文件頭為

header("Content-type:application/vnd.msword");
header("Content-Disposition:filename=test.doc");

就可以輸出.doc .xls等文件格式了

header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=test.xls");
echo "test1\t";
echo "test2\t\n"; //兩列之后換行
echo "test1\t";
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";

附一個文件格式對應(yīng)的數(shù)組

$mime_types = array(
'gif' => 'image/gif',
'jpg' => 'image/jpeg',
'jpeg' => 'image/jpeg',
'jpe' => 'image/jpeg',
'bmp' => 'image/bmp',
'png' => 'image/png',
'tif' => 'image/tiff',
'tiff' => 'image/tiff',
'pict' => 'image/x-pict',
'pic' => 'image/x-pict',
'pct' => 'image/x-pict',
'tif' => 'image/tiff',
'tiff' => 'image/tiff',
'psd' => 'image/x-photoshop',

'swf' => 'application/x-shockwave-flash',
'js' => 'application/x-javascript',
'pdf' => 'application/pdf',
'ps' => 'application/postscript',
'eps' => 'application/postscript',
'ai' => 'application/postscript',
'wmf' => 'application/x-msmetafile',

'css' => 'text/css',
'htm' => 'text/html',
'html' => 'text/html',
'txt' => 'text/plain',
'xml' => 'text/xml',
'wml' => 'text/wml',
'wbmp' => 'image/vnd.wap.wbmp',

'mid' => 'audio/midi',
'wav' => 'audio/wav',
'mp3' => 'audio/mpeg',
'mp2' => 'audio/mpeg',

'avi' => 'video/x-msvideo',
'mpeg' => 'video/mpeg',
'mpg' => 'video/mpeg',
'qt' => 'video/quicktime',
'mov' => 'video/quicktime',

'lha' => 'application/x-lha',
'lzh' => 'application/x-lha',
'z' => 'application/x-compress',
'gtar' => 'application/x-gtar',
'gz' => 'application/x-gzip',
'gzip' => 'application/x-gzip',
'tgz' => 'application/x-gzip',
'tar' => 'application/x-tar',
'bz2' => 'application/bzip2',
'zip' => 'application/zip',
'arj' => 'application/x-arj',
'rar' => 'application/x-rar-compressed',

'hqx' => 'application/mac-binhex40',
'sit' => 'application/x-stuffit',
'bin' => 'application/x-macbinary',

'uu' => 'text/x-uuencode',
'uue' => 'text/x-uuencode',

'latex'=> 'application/x-latex',
'ltx' => 'application/x-latex',
'tcl' => 'application/x-tcl',

'pgp' => 'application/pgp',
'asc' => 'application/pgp',
'exe' => 'application/x-msdownload',
'doc' => 'application/msword',
'rtf' => 'application/rtf',
'xls' => 'application/vnd.ms-excel',
'ppt' => 'application/vnd.ms-powerpoint',
'mdb' => 'application/x-msaccess',
'wri' => 'application/x-mswrite',
);

]]>
http://www.86956464.com/blog/view-287.html/feed 3306
琼海市| 诏安县| 汪清县| 宁强县| 龙南县| 江口县| 梁河县| 朝阳区| 航空| 富顺县| 牡丹江市| 鄂伦春自治旗| 九台市| 冷水江市| 团风县| 木兰县| 西盟| 诸城市| 漾濞| 崇义县| 清镇市| 塔河县| 宾阳县| 米脂县| 涿州市| 石台县| 洪江市| 乐至县| 勐海县| 泸定县| 扶绥县| 泸定县| 乌兰县| 大兴区| 特克斯县| 崇文区| 洱源县| 永新县| 叶城县| 桃源县| 张家川|