récupérer les informations qui se trouvent dans un fichier TXT et transformer en tableau
Bonjour,
J'ai une petite application qui vérifie si les comptes est existe.
Les informations sous forme d'email se trouve dans un tableau et qui marche bien.
Code:
1 2 3 4 5 6 7 8 9 10 11
| $lesEmails = array(
"toto1@toto.com",
"toto2@toto.com",
"toto3@toto.com"
);
Foreach($lesEmails as $value){
$identification = $value;
$loginVerification = new objet_toto();
$loginVerification->verificationCreationEmail($url, $identification);
} |
J'aimerais supprimer mon tableau et prendre les informations dans un fichier de TXT qui est comme cela :
"toto1@toto.com"
"toto2@toto.com"
"toto3@toto.com"
alors je fais :
Code:
1 2 3 4 5
| $lireLefichier = file($filename, FILE_IGNORE_NEW_LINES);
foreach ($lireLefichier as $ligne => $contenu)
{
echo $contenu;
} |
et j'obtiens :
Citation:
"toto1@toto.com"
"toto2@toto.com"
"toto3@toto.com"
Comment je peux transformer ma variable $contenu en array $lesEmails = array pour que mon boucle Foreach($lesEmails as $value) marche ?
Merci et bonne soirée