Colleagues.
I'm wanting to get the data from a txt file that contains the user's name and registration. Ex.:
Fernando Pessoa; 000011;
Ruth Cardoso; 000012;
....
When trying to get it this way:
$diretorio = 'arquivos/';
$arquivos = $diretorio . $_FILES['dados']['name'];
if (move_uploaded_file($_FILES['dados']['tmp_name'], $diretorio . $_FILES['dados']['name'])) {
$ler = fopen($arquivos,"r");
$conteudo = fread($ler,filesize($arquivos));
$dividir = explode(";",$conteudo);
foreach($dividir as $valores){
echo $dividir[0]." => ".$dividir[1]."<br>";
// aqui faço o cadastro
}
}
It returns only the first name and registration number repeating according to the total amount of data registered in the txt. If you have 30 names and registrations, you are bringing 30 times Fernando Pessoa 000011 and not the other data