How to create downloadable file

Project: in this project we will learn how to create downloadable file, image, folder from folder

PHP

File must be compressed with zip or rar format => filename.zip

In anchor tag href="uploads/filename.zip"

index.php
                            
                                <!DOCTYPE html>
                                <html>
                                <head>
                                 <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
                                </head>
                                <body>
                                  <div class="container "><br>
                                      <div class="row mt-2">
                                          <div class="col-md-6 offset-3 border p-4" style="background: #f5f6fa;">
                                            <!-- --------static download for Signle File-------- -->

                                            <a class="btn btn-info" download="filename.zip" href="uploads/filename.zip"><i class="fa fa-download"></i>Download</a>

                                            <!-- -----------Dynamically Download for multiple file using php code -->
                                             <?php
                                                $folder = "uploads";
                                                $files = scandir($folder,1);
                                                for ($x=2; $x<count($files); $x++) {   ?>
                                                    <a download="<?php echo $files[$x]; ?>" class="btn btn-primary  m-2" href="uploads/<?php echo $files[$x]; ?>"><i class="fa fa-download"></i>Download</a> <br>
                                             <?php  } ?>
                                         </div>
                                      </div>         
                                  </div>
                                </body>
                                </html>
                            
                          

css folder

You must download and include bootstrap css source files for good interface OR You can add cdn link from bootstrap website.
myproject/css
bootstrap.min.css