Skip to content

Instantly share code, notes, and snippets.

@franzejr
Created January 10, 2013 22:38
Show Gist options
  • Save franzejr/4506445 to your computer and use it in GitHub Desktop.
Save franzejr/4506445 to your computer and use it in GitHub Desktop.
Lendo linha por linha de um arquivo...
$usuario_senha = file_get_contents("users.txt");
$usuarios = array();
//Lendo linha por linha para pegar os usuarios
foreach(preg_split("/((\r?\n)|(\r\n?))/", $usuario_senha) as $line){
//echo $line."<br/>";
$line_it = explode(":", $line);
$usuarios[$line_it[0]] = $line_it[1];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment