Reputation: 11
I am getting the following error:
"Notice: fgetcsv() [function.fgetcsv]: delimiter must be a single character" in my browser
My PHP Code is as follows - can someone rearrange it please?
$fh = fopen('notes.txt', 'r') or die('Unable to open notes.txt');
while(($line = fgetcsv($fh, 0, '||')) !== FALSE)
if ($line[0] == $name) {
echo <<<EOL
My color is $line[2]
EOL;
break; // if there's only ever one '5678' line in the, get out now.
}
fclose($fh);
Upvotes: 0
Views: 2313
Reputation: 36
In simple words you are using tow characers "||" when you can only one like comma ",". Read the documentation.
Upvotes: 0