Skip to content

Instantly share code, notes, and snippets.

@dodopok
Created March 4, 2013 16:13
Show Gist options
  • Save dodopok/5083367 to your computer and use it in GitHub Desktop.
Save dodopok/5083367 to your computer and use it in GitHub Desktop.
Ler arquivo linha por linha
<?php
$arquivo = fopen('testes.txt', 'r');
if(!$arquivo){
echo 'Não foi possível abrir o arquivo';
}
else{
while(!feof($arquivo)){
$linha = fgets($arquivo);
echo rtrim($linha) . "<br>";
}
fclose($arquivo);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment