- Header ("Content-type:application/vnd.ms-excel");
- Header ("Content-disposition:filename=test.xls");
- echo "Test1\t";
- echo "test2\t\n"; Line wrapping after two columns
- 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";
Copy CodeAttached, an array corresponding to a file format. $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 ' and ' = ' 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 ' and ' = ' application/ Vnd.ms-powerpoint ', ' mdb ' = ' application/x-msaccess ', ' wri ' = ' application/x-mswrite ',); |