مینی پروژه فایل منیجر

پرسیده شده
فعالیت 1504 روز پیش
دیده شده 1020 بار
5
<?php 
    
    $path    = '../15miniPeroject';
  

    //اسکن کردن پوشه و گرفتن تمام فایل ها
    $filelist=scandir($path);
    
    //  حذف مفدار . و .. در ارایه فوق
    $files = array_diff($filelist, array('.', '..'));
    //print_r($files);
 
    ?>

<!DOCTYPE html>
<html lang="en">

    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">

    </head>
    <br>
    <br>
    <br>


    <body class="container">
        <table class="table table-light">
            <thead class="thead-light">
                <tr>
                    <th>نام فایل</th>
                </tr>
            </thead>
            <tbody>
                <!-- نمایش فایل ها -->
                <?php foreach ($files as $val) { ?>
                <tr>
                    <td><?php echo $val ?></td>

                </tr>
                <?php } ?>

            </tbody>

        </table>


    </body>

</html>

 

فایل پیوست

Daniyal Amiri
Daniyal Amiri

1 فروردین 99