Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Juozas

By: a guest on Feb 27th, 2012  |  syntax: PHP  |  size: 0.71 KB  |  hits: 151  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2.         require_once "class.writeexcel_workbook.inc.php";
  3.         require_once "class.writeexcel_worksheet.inc.php";
  4.        
  5.         $fname = tempnam("/tmp", "list.xls");
  6.         $workbook = &new writeexcel_workbook($fname);
  7.         $worksheet1 =& $workbook->addworksheet('name');
  8.         $heading =& $workbook->addformat(array('align' => 'center', 'bold' => 1));
  9.         $worksheet1->set_column(0, 1, 1);
  10.        
  11.         $string = "ėčščįęščūųüó"; // special characters
  12.        
  13.         $worksheet1->write(1, 0, $string, $heading);
  14.        
  15.         $workbook->close();
  16.        
  17.         header("Content-Type: application/x-msexcel; charset='UTF-8'; name=\"list.xls\"");
  18.         header("Content-Disposition: inline; filename=\"list.xls\"");
  19.         $fh=fopen($fname, "rb");
  20.         fpassthru($fh);
  21.         unlink($fname);
  22. ?>