Login   Register  
PHP Classes

File: demo.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of dbforch  >  PHP CSV XLS Converter  >  demo.php  >  Download  
File: demo.php
Role: Example script
Content type: text/plain
Description: Demo script
Class: PHP CSV XLS Converter
Convert data from CSV files to Excel XLS format
Author: By
Last change: Generates a test csv file and noticing the user that PHPExcel (www.phpexcel.net) is required to run this demo.
Date: 1 year ago
Size: 748 bytes


Class file image Download

// required class
require_once "CSVToExcelConverter2.class.php";
// requires the PHPExcel library (www.phpexcel.net)
  // require_once "path/to/PHPExcel.php";

  // source csv file
$csv_file 'test.csv';
// create the source test csv
if(($fh fopen($csv_file'w+')) !== false) {
fputcsv($fh, array(
  else {
"unable to perform demo, test csv file could not be created";
// start converting
  // xls filename will be automatically generated
$converter = new CSVToExcelConverter2($csv_file);