|
Posted by Oli Filth on 01/10/06 16:20
nescio said the following on 10/01/2006 12:40:
>>>but i want to check if the delimiter they choose is the same as in the
>>>csv-file)
>>
>>I guess you could call fgetcsv() with the specified delimiter, and if
>>it returns FALSE then you know it didn't work.
>
> yes, that could be done, but if the specified delimiter is wrong but the
> sign appears in the first line
> it will return true, isn't it?
>
> lets say they choose the sign '^', and in the csv-file the first line is:
> "232";"4^dfd";"232323"
> the return will be 'true', or am i mistaken?
>
Well, if the CSV is equally valid with two different delimiters, then
there's nothing you can do.
The best you could hope to do is validate the data itself, e.g. ensure
that there's a set number of fields per line, that each field is of the
correct format, etc.
--
Oli
[Back to original message]
|