To find the contents of a directory in PHP, you can use the scandir() or readdir() function.
Here is an example using scandir():
main.php310 chars15 lines
And here is an example using readdir():
main.php411 chars19 lines
Both of these functions will return an array with the names of the files and directories in the specified directory. The . and .. entries are included, so you will need to skip over those if you don't want to include them in your output.
gistlibby LogSnag