In this way, an image can be displayed, but what should I do if I want to display all the images in the img folder? I cannot change it to $ url & #039; upload & #039; what should I do? {Code...} can display an image, but what should I do if I want to display all the images in the img folder? I cannot change it to $ url = 'upload/'. what should I do?
Header ("Content-Type: image/jpeg; text/html; charset = utf-8" encode your url0000'1.jpg '; $ img = file_get_contents ($ url, true); echo $ img;
Reply content:
In this way, an image can be displayed, but what should I do if I want to display all the images in the img folder? I cannot change it to $ url = 'upload/'. what should I do?
Header ("Content-Type: image/jpeg; text/html; charset = utf-8" encode your url0000'1.jpg '; $ img = file_get_contents ($ url, true); echo $ img;
There are many methods. examples are as follows:
$ Dir = "upload/"; // if (is_dir ($ dir) {if ($ dh = opendir ($ dir) directory to be obtained )) {while ($ file = readdir ($ dh ))! = False) {$ filePath = $ dir. $ file; echo "" ;}closedir ($ dh );}}