Created
April 5, 2015 17:23
-
-
Save helisoncruz/23e3e4261dfae117d6db to your computer and use it in GitHub Desktop.
Ler TXT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$arquivo = 'profissoes_lista.txt'; | |
$ponteiro = fopen ($arquivo,"r"); | |
while (!feof ($ponteiro)) { | |
//LÊ UMA LINHA DO ARQUIVO | |
$linha = fgets($ponteiro,4096); | |
$linha = utf8_encode($linha); | |
$linha = str_replace('ÿþ','',$linha); | |
$linha = explode(',',$linha); | |
if($linha != ' '){ | |
$dados = array( | |
'cod'=>$linha['0'], | |
'profissao'=>$linha['1'], | |
); | |
$conecta->inserir('profissoes',$dados); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment