Utilisation de ‘chdir( )’ pour lister le contenu d’un répertoire

Author:

 fichiers
Download

<html>
<head>
<title>String</title>
</head>
<body>

<?php

    $mon_rep = "String";
    chdir($mon_rep)
     or die("Impossible d'ouvrir ($mon_rep)");

    $dh = opendir('.');
    print "Les fichiers du répertoire $mon_rep:";
    while ($fichier = readdir($dh)) :
         print "$fichier <br>";
    endwhile;
    closedir($dh);
?>

</body>
</html>

Leave a Reply

Your email address will not be published. Required fields are marked *


six × = 30