PHP
snowpape
-
fathy47 Messages postés 2233 Statut Membre -
fathy47 Messages postés 2233 Statut Membre -
Bonjour,
je vourais kon mexplique cette ligne if(substr($fichier,-4)==".php"), je n'y comprend rien
<?php
$pf=fopen("compilation.text","w+") or die("Fichier non créé");
echo "Le fichier est créé<br/>";
$dir=opendir('.');
while($fichier=readdir($dir))
{
if(substr($fichier,-4)==".php")
{
fputs($pf,"$fichier\n");
}
}
echo "Les fichiers .php ont été ajouté dans compilation.txt";
fclose($pf);
closedir($dir);
?>
merci
je vourais kon mexplique cette ligne if(substr($fichier,-4)==".php"), je n'y comprend rien
<?php
$pf=fopen("compilation.text","w+") or die("Fichier non créé");
echo "Le fichier est créé<br/>";
$dir=opendir('.');
while($fichier=readdir($dir))
{
if(substr($fichier,-4)==".php")
{
fputs($pf,"$fichier\n");
}
}
echo "Les fichiers .php ont été ajouté dans compilation.txt";
fclose($pf);
closedir($dir);
?>
merci
Configuration: Windows XP Firefox 3.0