Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of H. Poort  >  b3rtCSVReader  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example script
Class: b3rtCSVReader
Parse CSV files in pure PHP
Author: By
Last change: Redundant call removed
Date: 7 years ago
Size: 391 bytes
 

Contents

Class file image Download
<?php
//header('Content-Type: text/plain');

require 'class.b3rtCSVReader.php';

$csvReader = new b3rtCSVReader();
$csvReader->setFilename('./example.csv');
$csvReader->setDelimiter(';');

while (
$csvRecord $csvReader->fetchRecord())
    
print_r($csvRecord);

if (
$csvReader->getErrors())
{
    echo 
"\nErrors:\n";
    
print_r($csvReader->getErrors());
}

unset(
$csvReader);
?>