assuming you have an excel-style csv file placed on your server.
<?
// test search key - should come from elsewhere
$search_key = 'abc';
$datafile = file('data.csv');
foreach($datafile as $line)
{
if(stristr($line, $search_key) !== false) // found!
{
echo "Key found in record:<br />";
// separate record fields
$fields = explode(';', trim($line));
foreach($fields as $field)
echo $field."<br />"; // field output
echo "<hr />"; // horizontal separator
}
}
this spits out all fields from all records where the key has been found nicely.
maybe you want to look up in the www.php.net manual:
file() function
explode() (aka "split") function
for, foreach loops
array handling
hope this helps.