>Problem with looping over a CSV file (3 results for each line)?
>
>Here is the script...
><?php
>$row = 1;
>$file = "fa.csv";
>$id = fopen("$file","r");
>   while($data = fgetcsv($id,100,",")) {
>   $num = count($data);
>   $row++;
>     for($c = 0; $c < $num; $c++) {
>        echo "host $data[0] {<br />\nhardware ethernet $data[1];<br
>/>\nfixed-address $data[2];<br />\n}<br />\n"; }
>       }
>fclose($id);
>?>

Remove the for-loop on the 8th line.

---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca            http://mike.teczno.com/contact.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to