1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| <?
while ($result = mysql_fetch_array($ask)){
$path = '/chemin/';
$pseudo_fiche = $ask['pseudo']; // c'est pas plutôt $result ?
$fichiers = array();
foreach(new DirectoryIterator($path) as $dir){
if(!$dir->isDot() && substr($dir->getFileName(),0,5) == "fich_"){
$f_users = file($dir->getPathName());
foreach($f_users as $line => $f_user)
{
$f_line = trim($f_user);
if ($f_line == $pseudo_fiche) {$fichiers[substr($entry,5,20)-".txt"][] = $pseudo_fiche; }
}
}
}
foreach($fichiers as $fiche => $fichier)
echo 'dans la fiche '.$fiche.' se trouvent les pseudos '.implode(', ', $fichier);
} |
Partager