I would like to echo a chosen field in a row in a csv file
this csv file has for example 23 columns and 35 rows
Code: Select all
<?php
$row = 0;
$handle = fopen("example.txt", "r");
while (($data = fgetcsv($handle, 10000, ",")) !== FALSE) {
$num = count($data);
$row++;
for ($c=0; $c < $num; $c++){
echo $data[1] ."<br>------<br>\n";
}
}
fclose($handle);
?>I would like to echo only $data[1] of for example $row[3]
If this is possible, any help most welcome.
Thank you for your kind interest.