PHP Classes

File: csv2html-doc.html

Recommend this page to a friend!
  Classes of Srinivasan Ramakrishnan  >  csvtohtml  >  csv2html-doc.html  >  Download  
File: csv2html-doc.html
Role: ???
Content type: text/plain
Description: Documentation for csvtohtml in PHP manual style
Class: csvtohtml
Converts a CSV file into a HTML table
Author: By
Last change:
Date: 21 years ago
Size: 2,536 bytes


Class file image Download
<!DOCTYPE html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<TITLE>CSV2HTML - Documentation</TITLE>
<BODY bgcolor="#FFFFFF">
(PHP3 &gt;= 3.0.8, PHP4)<BR>
csvtohtml -- Converts a CSV file to a HTML table 
<TABLE width="100%" border="0" bgcolor="#CCCCCC">
    <TD> <CODE>&string [&boolean] &csvtohtml(string $csvFilePath, string $htmlFilePath, 
      int $maxRowLength, string $htmlTableStyle [, string $delimiterString = ","])</CODE> 
<PRE>string $csvFilePath</PRE>
- Must point to a valid CSV file path 
<PRE>string $htmlFilePath</PRE>
- The output HTML file destination path, NULL if output is to be only as return 
<PRE>int $maxRowLength</PRE>
- The max number of characters on any line in the CSV file 
<PRE>string $htmlTableStyle</PRE>
- The HTML style elements in a table, can be left as a zero length string for 
default styling as per browser 
<TABLE width="75%" border="0" bgcolor="#CCCCCC">
      <PRE> Ex: 'align="center" background="bg.gif" border="3"'</PRE>
<PRE>string $delimiterString</PRE>
- By default assumed as , (comma). Denotes the delimiting character between fields 
  The function will return a reference to a variable containing the HTML code 
  for creating the table containing the CSV records.However an output HTML file 
  path may be specified to allow output to an HTML file. The returned reference 
  will contain a boolean false if an error occurs.</P>
<P>If output need not be stored as an HTML file the <CODE>$htmlFilePath</CODE>must 
  be set to NULL.</P>
<TABLE width="75%" border="0" bgcolor="#CCCCCC">
 $output = &amp;csvtohtml("test.csv", NULL, 1000, "border='0'", ";");
 csvtohtml("test.csv", "test.html", 1000, "border='0'", ";");
 $output = &amp;csvtohtml("test.csv", "test.html", 1000, "");
<table width="75%" border="0" bgcolor="#CCCCCC">
$output = &csvtohtml("addbook2.csv", "test.html", 1000, 'bgcolor="#cccc66" align="center" width="50%" border="0" valign="middle"');
csvtohtml("addbook3.csv", "xvb.html", 1000, "");
echo $output;
For more information send a message to info at phpclasses dot org.