In a website HTML Table, I need to have the table populate with the names of PDF files located on a specific directory of the website.
Example:
Years on left-side of table: 2010, 2011, 2012
Months across top of table: Jan, Feb, Mar
The data records need to pull from a structured folder setup from the site’s root:
html_public/uploadedfiles/files_type_a/2010/01jan
html_public/uploadedfiles/files_type_a/2010/02feb
html_public/uploadedfiles/files_type_a/2010/03mar
So, a PDF document that has been uploaded into the /01jan folder would display that PDF file’s name in the appropriate cell of the HTML table.
This PHP code will iterate through the directory you specify and put all of the PDF files it finds into an array called
$files. You may need to adjust the$dir.This part will make an HTML table and display all of the applicable files: