0
I need to ignore the first line of a file I’m importing in csv with php, this first line is a header, some hint how can I do this? I tried to make an accountant, but I couldn’t fix it, what I have is this:
if (!empty($_FILES)) { $tempFile = $_FILES['userImage']['tmp_name']; $Dados = file($tempFile); foreach($Dados as $RegLinhas) { // RETIRA ESPAÇOS NO INÍCIO E FIM $Linha = trim($RegLinhas); // DIVIDE A STRING $CamposImport = explode(';', $Linha); $IdPessoa = $CamposImport[0]; $Nome = $CamposImport[1]; $IdUnicoop = $CamposImport[2]; $DataAdmissao = $CamposImport[3]; $IdCargo = $CamposImport[4]; $LotacaoRH = $CamposImport[5]; $CTPS = $CamposImport[6]; $CTPSSerie = $CamposImport[7]; $CTPSUF = $CamposImport[8]; $DataNascimento = $CamposImport[9]; $CPF = $CamposImport[11]; } }
Hello @Miguel, spectacular tip, thank you very much, both ways worked.
– adventistapr
@adventistapr still well. Good luck
– Miguel