I’m building a CSV import where the first row is the column names of everything else. Instead of having $row[0] I’d like to use $row['id'] to keep the code readable and make it easier for future developers. The problem is… I can’t think of an efficient way to do this…
while (($current = fgetcsv($handle, 1000, "\t")) !== false) {
if ($row == 0) {
}
}
The only methods I can think of require a bit of legwork and I’d like to just have a simple solution that’s clean and easy (every developers dream, I know). So I thought I’d post here and see if someone had a better method than what I’m thinking…
Nevermind… just found array_combine on PHP.net… it looks like exactly what I need
I’d delete my question but I think this would be useful for some people to know…