I\'m having some problems:
This code works:
$fp = fopen ($file,\"r\");
while ($data = fgetcsv ($fp, 1000, \"\t\")) {
..........
}
but I want to be able so switch the delimiters on the fly like this:
$delimit=\'\t\';
$fp = fopen ($file,\"r\");
while ($data = fgetcsv ($fp, 1000, \"$delimit\")) {
..........
}
I\'ve tried single quotes, double quotes. I\'ve tried $delimit=\"//t\" and everything I can think of.
It only works when I put the \"\t\" in the actual while loop. When I use a comma delimiter; $delimit=\',\' ... the code works but not with the tab delimiter. Does anyone have any ideas?
Thanks,
Mark