I started off with this code
do {
$line=fgets($fh,4096);
$linesize=strlen($line);
list($blank,$blank,$blank,$model2,$checkloop,$blank,$blank,$blank,$image2,$description)=csv_explode($line,',','"');
$model[]=$model2;
$image[]=$image2;
} while($checkloop=='');
and then quickly realised that I would get an extra entry in the $model and $image arrays because the check on the recieved data is at the end.
I have changed it to the following but I'm sure there must be a simple construct for achieving this without repeating code (as I see it eather repeating the code for getting the data as below or repeating the condition in the while in an if within the while)
$linesize=strlen($line);
list($blank,$blank,$blank,$model2,$checkloop,$blank,$blank,$blank,$image2,$description)=csv_explode($line,',','"');
while($checkloop=='') {
$model[]=$model2;
$image[]=$image2;
$line=fgets($fh,1048576);
$linesize=strlen($line);
list($blank,$blank,$blank,$model2,$checkloop,$blank,$blank,$blank,$image2,$description)=csv_explode($line,',','"');
}
Any ideas?
Thanks
Bubble