I need a simple php code to alphabetically list folders and subfolders of a directory on my website.
The website is php, mysql based.
I have the website on both my local machine and a remote server. On the local machine, I installed an Apache server using an older WinLamp 4.0.0 that has PHP 4.4.9, mysql [url removed, login to view], Apache [url removed, login to view]
The remote server has PHP 5 and mysql 5
I'm getting the Fatal error: Call to undefined function: scandir(), if I try to use that function on either the local machine or the remote server. So it would be easier just to leave that function out.
I've tried two simple php codes. The first one lists the folder and subfolder. It lists them alphabetically on the local machine, but does not list them alphabetically on the server.
I've tried another simple code that lists the folders alphabetically on both local and server, but only lists the main folder, and not subfolders.
I need a php code that does both, and I would like something I can just copy and paste into the page.