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: [EMAIL PROTECTED]
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
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php