You are here:  » Reference field ID instead of name - i.e. $record[0]


Reference field ID instead of name - i.e. $record[0]

Submitted by r_s on Tue, 2011-08-09 03:20 in

I have CSV file with a header row, but the name of field #1 is different with every update because it is used as a timestamp. Therefore, I cannot reference it by name as I do for the other fields, is there a way to reference it by ID? I have tried a few things like $record[0] but I haven't gotten it to work. What am I missing? Thanks...

Submitted by support on Tue, 2011-08-09 07:05

Hi,

The best thing to do would be to use array_shift(), for example:

  $field1 = array_shift($record);

Hope this helps!
Cheers,
David.
--
MagicParser.com