I want to display all the images in the upload directory in my server browser. how can I get this code? I saw an example on the Internet, but I wouldn't use the second foreach to write anything? I have no pages, and I have two images {code...}. I want to display all the images in the upload directory in my server browser. how can I get this code?
I saw an example on the Internet, but I wouldn't use the second foreach to write anything? I have no pages. there are only two images in it.
$ Img = array ('GIF', 'PNG ', 'jpg'); // suffix of all images $ dir = 'data /'; // folder name $ pic = array (); foreach ($ img as $ k => $ v) {$ pattern = $ dir. '*. '. $ v; $ all = glob ($ pattern); $ pic = array_merge ($ pic, $ all);} foreach ($ pic as $ p) {// code displayed on the branch page}
Reply content:
I want to display all the images in the upload directory in my server browser. how can I get this code?
I saw an example on the Internet, but I wouldn't use the second foreach to write anything? I have no pages. there are only two images in it.
$ Img = array ('GIF', 'PNG ', 'jpg'); // suffix of all images $ dir = 'data /'; // folder name $ pic = array (); foreach ($ img as $ k => $ v) {$ pattern = $ dir. '*. '. $ v; $ all = glob ($ pattern); $ pic = array_merge ($ pic, $ all);} foreach ($ pic as $ p) {// code displayed on the branch page}
Make a soft link to your image folder to a web-accessible directory. Then you can write a web page to display them cyclically.
If your directory can be accessed, you can write HTML output in your existing code segment.
Do you want the following effects:
System ("path of the image browsing program ")
......