readdir works fine in local directories, but when I try to reaadir remote dirs, php does not recognize them if they are an URL like: http://www.grn.es/imagic/audio
$path_to_files = '/Library/WebServer/Documents/portal/audio'; // local dir, works fine!
$path_to_files = 'http://www.grn.es/imagic/audio'; // remote dir, does not work ;(
if ($handle = opendir($path_to_files)) {
echo "Directory handle: $handle\n";
echo "Files:\n";
while (false !== ($file = readdir($handle))) {
echo "$file\n";
}
closedir($handle);
}
May be some php preferences for URLs, like:
$path_to_files = '\http://www.grn.es/imagic/audio';
see the back slash... (one or two?)
If you've been in the same, it will be easy for you to reply, THANKS!
The problem is at opendir, or before...