Created
May 16, 2013 23:12
-
-
Save muriloazevedo/5595841 to your computer and use it in GitHub Desktop.
leitura de arquivo
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
<?php | |
$arquivo = file('file.txt'); // arquivo em ISO-8859-1 | |
foreach ($arquivo as $linha) { | |
$dados_linha = explode(';', $linha); | |
echo '<pre>' . print_r($dados_linha) . '</pre>'; | |
} | |
/** | |
Array ( [0] => ES [1] => VITÓRIA [2] => JOÃO [3] => PRODUTO 1 ) | |
1 | |
Array ( [0] => ES [1] => VITÓRIA [2] => JOÃO [3] => PRODUTO 1 ) | |
1 | |
Array ( [0] => ES [1] => VITÓRIA [2] => JOÃO [3] => PRODUTO 1 ) | |
1 | |
Array ( [0] => ES [1] => VITÓRIA [2] => JOÃO [3] => PRODUTO 1 ) | |
1 | |
Array ( [0] => ES [1] => VITÓRIA [2] => JOÃO [3] => PRODUTO 1 ) | |
**/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment