So let's say that your CSV file contents looked like this:
Code:
"ID","USERNAME","LASTNAME"
"00540000000wxjkAAA","heather@sportsrant.com","Simonds"
"00540000000wvEyAAI","simonds@sportsrant.com","Simonds"
So to test this, you could write a simple foreach () loop after passing this function your CSV file
PHP Code:
$file = 'extract.csv';
$data = importcsv($file, $head = true);
foreach ($data as $line)
{
echo '<pre>' . print_r($line, true) . '</pre>';
}
exit;
and your output would be something like this:
Code:
Array
(
[ID] => 00540000000wxjkAAA
[USERNAME] => heather@sportsrant.com
[LASTNAME] => Simonds
)
Array
(
[ID] => 00540000000wvEyAAI
[USERNAME] => simonds@sportsrant.com
[LASTNAME] => Simonds
)
This is really a great PHP snippet for parsing CSV files and extremely easy to use