How can I use scandir with an URL. Now it looks like PHP doesn\'t see the URL as an URL. Is there a way to use an URL in scandir?
This is not possible. scandir() and many other file operations only work local.
If you want to get a list of files on a remote server then you need a script/API on the server that will return that file list.
Just imagine what would happen if you could read all files and directories on a remote machine? Security would be realy compromised.