2
I need to scroll through a CSV file to capture a value and print it on the screen.
Example:
Column "N" line "2", in this case it is cell N2 that is written: 2,98
How to print this N2 cell on the screen? How to get there?
<?php
$h = fopen("produtividade do trabalho.csv","r");
$i = fgetcsv($h, null, ",");
foreach ($i as $indice => $valor) {
echo var_dump($i);
}
?>
In the code above he prints this for me:
array(1) { [0]=> string(278) "trabalho;"Código do projeto";"Código do item";"Data de início do trabalho real";"Data final do trabalho real";"Nome da linha";"Desempenho";"Disponibilidade";"Eficiência da linha";"Unidades produzidas";"Unidades previstas";"Unidade de medida";"Unidades padrão por hora";"Duração"" }
In which case, that’s all that’s on line 1.
Perfect! That’s what I needed! Thank you very much, I’ve been looking for this for a long time, haha. Now I will give an update and implement in my code. Thank you!
– Alex_Alex_Alex
And like, there in col == 14, it goes through and up to the letter N, right. Now, if I just want to take line 2? And not the whole "N". Because in this perfect example, he gives me everything he has on N. And I need to just pick up line 2
– Alex_Alex_Alex
You need to make the comparison with the '$Row' tbm, if($Row == 2){ //block }
– AnthraxisBR
Thank you very much again!
– Alex_Alex_Alex