3
I have a code where I read the EXCEL file. CSV and display the data on the screen, but I need to save these values in an array.
My code:
<?php
$file = fopen(numeros.csv', 'r');
while (($line = fgetcsv($file)) !== FALSE)
{
//$line is an array of the csv elements
print_r($line);
}
fclose($file);
?>
$arrayItem= array('8532300022', '8501022934', '8501022969', '8501022926', '8501022985');
It would have to look something like:
$arrayItem= array('$line');
Valew
Good afternoon, seeing the questions you asked, I think the problem is that you are not understanding well how the PHP language works and it seems to me that you are wanting to apply some "your head" logics that do not make much sense, I say this because the author of the answer here show you how you use php and you want it in a way that I don’t know in any language I’ve programmed. I hope you don’t take this as a constructive criticism for your learning.
– Guilherme Nascimento