RE: [PHP-WIN] CSV. Parsing a defined row?

From: Date: Thu, 06 Jun 2002 00:28:24 +0000
Subject: RE: [PHP-WIN] CSV. Parsing a defined row?
Groups: php.windows 
Request: Send a blank email to php-windows+get-14096@lists.php.net to get a copy of this message
do you mean? // load your csv $fp = fopen('your.csv', 'r'); while(($line = fgetcsv($fp, 4096)) && $line[0] != $_GET['id']); // the loop terminated...possible outcomes are a match or EOF, in which // case $line will be boolean and not an array if (is_array($line)) { // you matched the correct line, now use the contents of $line array } else { // a match was not found; do the appropriate thing } -----Original Message----- From: FrankThiel To: php-windows@lists.php.net Sent: 6/5/02 6:38 AM Subject: [PHP-WIN] CSV. Parsing a defined row? Hello, i couldn´t find an answer in the NewsArchive. How can i parse a CSV file, and show a defined row taken from an url. I have got this link www.something.com/something.php?id=234 the CSV example: id,article,category 233,art1,cat1 234,art2,cat2 235,art3,cat3 I do know how i can parse a whole file with fgetcsv, but not how to parse an explicit line. THX for help. Frank Thiel -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.windows (#14096) next »