Re: CSV.php question

From: Date: Wed, 05 Jun 2002 12:13:09 +0000
Subject: Re: CSV.php question
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-1584@lists.php.net to get a copy of this message
What about that (not tested code): <?php require 'File/CSV.php'; $file = 'your_csv_file'; $conf = File_CSV::discoverFormat($file); $i = 0; while($row = File_CSV::read($file, $conf)) {
        if ($i++ == 1) {
                row2HTML($row);
                continue;
        }
        if ($row[0] == 234) {
                row2HTML($row);
                break;
        }
} function row2HTML($row) {
        print '<tr><td>'.$row[0].'<...;
} ?>
Hello Tomas, now i do get this ErrorMessage: Fatal error: Call to undefined function: getstaticproperty() in e:\htdocs\projekte\File.php on line 120 This is my code: <?php require 'CSV.php'; $file = 'file.csv'; $conf = File_CSV::discoverFormat($file); $i = 0; while($row = File_CSV::read($file, $conf)) {
        if ($i++ == 1) {
                row2HTML($row);
                continue;
        }
        if ($row[0] == $buy) {
                row2HTML($row);
                break;
        }
} function row2HTML($row) {
        print '<tr><td>'.$row[0].'</td></tr>';
} ?> And this is the Link: http://127.0.0.1/projekte/csvfile.php?buy=234 THX Frank

« previous php.pear.general (#1584) next »