I have folders that contains images that changes every 7 days. and the filename of the folders are dates.
I want to use the filename of those folders to display them to a website.
What I have tried:
I used scandir to list the folders and this is the output:
(
[0] => 20220728_1500
[1] => 20220728_1800
[2] => 20220728_2100
[3] => 20220729_0000
[4] => 20220729_0300
[5] => 20220731_2100
[6] => 20220801_0000
[7] => 20220801_0300
[8] => 20220804_0600
[9] => 20220804_0900
[10] => 20220804_1200
[11] => 20220804_1500
[12] => 20220804_1800
[13] => 20220804_2100
[14] => 20220805_0000
[15] => 20220805_0300
)
This is a part of my JS Script which is supposedly where the folder filenames will be placed.
var basicdate_folders= {
"": {
"date": "",
},
"": {
"date": "",
},
"": {
"date": "",
},
"": {
"date": "",
},
"": {
"date": "",
},
"": {
"date": "",
},
"": {
"date": "",
},
"": {
"date": "",
},
}
And I this is the HTML
<select multiple class="form-control" id="select-date" name="select-datej">
<option disabled>Select an Initialization Date</option>
<option selected value=""></option>
<option value=""></option>
<option value=""></option>
<option value=""></option>
<option value=""></option>
<option value=""></option>
<option value=""></option>
<option value=""></option>
</select>
The supposed to have the foldername ie. 20220722_1500
I tried to use JSON ENCODE but since I'm new to Web Languages I'm having trouble what comes after that.