Source for file CSVFiles.class.php
Documentation is available at CSVFiles.class.php
* For including this file you have to define the constant "CLASSPATH".
* Because every include in the framework depends on the CLASSPATH definition.
* The CLASSPATH means the relative path to the folder that contains the
echo "<h3>You have to define the constant CLASSPATH!</h3>\r\n";
echo "Example: define( 'CLASSPATH', '../path/to/classes/' );\r\n";
include_once( CLASSPATH. "filesystem/Files.class.php" );
include_once( CLASSPATH. "core/Arrays.class.php" );
include_once( CLASSPATH. "core/Strings.class.php" );
* A class to manage files with comma separated values.
* @author Daniel Plücken <daniel@debakel.net>
* @license http://www.gnu.org/copyleft/lesser.html
* GNU Lesser General Public License
* @copyright Copyright (c) 2006 Daniel Plücken <daniel@debakel.net>
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
* @var char $separator_chart
* @var char $enclosing_char
* @var char line_terminator_char
* @var array $content_arr
* @param string $path_and_filename
* @param string $filename
function CSVFiles( $path, $filename = "" )
* Stores the number of columns of this csv-file object.
{ $this->cols = $int_cols; }
* Returns the number of columns of this csvfile object.
* Stores the number of columns of this csv-file object.
if ( empty( $this->cols ) )
echo "To insert a value in a cell of an csv-file, set the number of "
. "columns in this file first!";
if ( $int_actual_row < 0 )
if ( $int_next_col >= $this->cols )
$this->content_arr[$int_actual_row][$int_next_col] = $str_val;
* Sets the header for an excel output.
header( "Content-type: application/x-msexcel" );
header( "Content-disposition: attachment; filename=". $this->filename );
* Returns the content of this file object.
} // End of class CSVFiles
|