PHP generates excl, Word files

Source: Internet
Author: User

PHP generates excl, Word files

$time = time ();
$filename = Date ("Y years M D Day h points m minutes s seconds", $time). ' Questionnaire data ';
$rows = sp_looks_vote::d ownvote ();
$file = $filename. ". CSV ";
Header (' Content-description:file Transfer ');
Header (' Content-type:application/octet-stream ');
Header (' content-disposition:attachment; Filename= '. basename ($file));
Header (' content-transfer-encoding:binary ');
Header (' expires:0 ');
Header (' Cache-control:must-revalidate, post-check=0, pre-check=0 ');
Header (' Pragma:public ');

$tabletitle. = "Purchase address, often buy, like models, content how, impressions, whether to buy, how to feel, how to buy, how to buy, how to attract points, improve suggestions";

$conter = Iconv (' utf-8 ', ' GBK ', $tabletitle). " \ n ";

echo $conter;d ie;

By the way, the simple export Word document code to paste here:

<?php
Header ("Content-type:application/msword");
Header ("content-disposition:attachment; Filename=doc.doc ");
Header ("Pragma:no-cache");
Header ("expires:0");

$output = ' <table border= ' 1 "cellspacing=" 2 "cellpadding=" 2 "width=" 90% "align=" center ">";
$output. = ' <tr bgcolor= ' #cccccc "><td align=" center "> Pictures </td></tr> ';
$output. = ' <tr bgcolor= ' #f6f7fa "><td><span style=" color: #FF0000; " ><strong> below is a picture </strong></span& gt;</td></tr> ';
$output. = ' <tr><td align= ' center ' ></td></tr > ';
$output. = ' </table> ';


Echo $output;
?>

Warm tip: This article is for copying others. Designed for personal Learning

PHP generates excl, Word files

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.