PHP Classes

File: example/index.php

Recommend this page to a friend!
  Classes of Developer CK  >  Multipart CSV  >  example/index.php  >  Download  
File: example/index.php
Role: Example script
Content type: text/plain
Description: example
Class: Multipart CSV
Write data into multiple CSV files of limited size
Author: By
Last change:
Date: 3 years ago
Size: 1,684 bytes


Class file image Download
 * In this file ,i ll explain each method of class that can be access.
include_once '../class/multiPartCSV.php';

//-settig properties.if you will not set it wil use default
$filename = 'sample.csv'; // zip name will be filename
$nol = 2; // number of line per csv
// if you specify header and footer will be included with each generated csv
$header = array(
$footer = array(
$path = ""; // where you wanna store zip file , defualt wil be zip.

//------ making a object
$multipartCSV = new MultipartCSV($filename, $nol, $header, $footer, $path);

$data = array(array(1,2,3),2,3,4,5,6,7,8,9);

//--- write data in one csv only
//-function 1
//$multipartCSV->dataAtOnceInOneCSV($data ,true);//$zip true
//-function 2 // break down data and write multiple csv, function should be used once.
//$multipartCSV->dataAtOnceInParts($data ,true);//$zip true
//--function -3
//--- data per csv
//$multipartCSV->makeZip(); return all dile in a zip on specified path

//--function -4
// insert data one by one and auto manage tp parts,e-g. it will create 3 csv
// b/c no of limit per csv is 2 line

//---data foramt passed to these function should be, a 2-d array row by col