I'm am reading data froma CSV file, after the line is read I am using strtok to break the line up using the comma as the deliminator.
So far so good, the problem arises because some of the fileds are empty and strtok just skipps them. Is the a way round this?
eg:
Line: a,b,,d
I need to get 4 variables:
$val1 = 'a'
$val2 = 'b'
$val3 = ''
$val4 = 'd'
any suggestions?
Thanks in advance
So far so good, the problem arises because some of the fileds are empty and strtok just skipps them. Is the a way round this?
eg:
Line: a,b,,d
I need to get 4 variables:
$val1 = 'a'
$val2 = 'b'
$val3 = ''
$val4 = 'd'
any suggestions?
Thanks in advance