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 dasar  >  csv2table  >  example.php  >  Download  
File: example.php
Role: ???
Content type: text/plain
Description: A demo php file to show the usage of csv2table class. (uses test.csv)
Class: csv2table
Author: By
Last change:
Date: 13 years ago
Size: 1,040 bytes
 

Contents

Class file image Download
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
       <title>Example</title>
</head>

<body>
<center><h2>csv2table demo.</h2></center>
<?
include "csv2table.inc";

$cs = new csv2table();

$csvfile="test.csv";
$title="CSV Table Demo";

//Listing all names
echo "<br><center><h4>Listing all names</h4></center>";
//$cs->set_tablewidth("60%");
$cs->showtable($csvfile,$title);

//Listing all names where age greater than 35
echo "<br><hr><br><br><center><h4>Listing all names where age greater than 35</h4></center>";
$fields = "1,2,3";
$filter[2] = ">,35";
$cs->set_tablewidth("30%");
$cs->showtable($csvfile,$title,$fields,$filter);

//Listing all names where age greater than 35 and city is London
echo "<br><hr><br><br><center><h4>Listing all names where age greater than 35 and city is London</h4></center>";
$fields = "1,2,3";
$filter[2] = ">,35";
$filter[3] = "=,London";
$cs->set_tablewidth("30%");
$cs->showtable($csvfile,$title,$fields,$filter);

?>
</body>
</html>