Login   Register  
PHP Classes

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 Steven de Boer  >  csvUtil  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example use of class csvUtil
Class: csvUtil
Display and search CSV file fields
Author: By
Last change:
Date: 11 years ago
Size: 744 bytes


Class file image Download

include ("class.csvUtil.php");
$websites = new csvUtil("websites.csv"",");

# Define column names
define (NAME"0");
define (URL"1");

# Print our links
echo "<B>Print complete content.</B><BR>";
$i 0;
while (
$result $websites->getField($iNAME)) {
$link $websites->getField($iURL);
"<A HREF='$link'>$result</A><BR>";

<BR><BR><B>Search for "php" sites.</B><BR>
# Use search
$result $websites->search(NAME"php");

# Print result
$i 0;
do {
$name $websites->getField($result[$i], NAME);
$link $websites->getField($result[$i], URL);
"<A HREF='$link'>$name</A><BR>";
} while (