I have a simple CSV table
Name,Year of birth,City
Yeremy,1980,New York
Louis,1982,Washington
Marta,1987,Chicago
David,1985,Los Angeles
Also, I have this code to can get cell value by number of row and number of column:
$trow = 3;
$tcolumn = 3;
$output .= '<span>';
$row = 1;
$mycsvfile = array();
if (($handle = fopen($abspath, "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
$row++;
$mycsvfile[] = $data;.
}
fclose($handle);
}
$output .= $mycsvfile[$trowN][$tcolumnN];
$output .= '</span>';
I want to define that $trow=Marta and $tcolumn=City, so, in this case to get value "Chicago"...