PHP DirectoryIterator用于远程定位

时间:2018-11-01 14:40:44

标签: php iterator

我正在尝试读取远程服务器上mp3文件的文件夹。 DirectoryIterator可以做到这一点吗?

$dir = "http://pspc.dyndns.info/~pspc/audio/2018-10-28_1528/";

$dit = new DirectoryIterator($dir);
foreach ($dit as $fileinfo) {

}

我遇到错误:

 Uncaught UnexpectedValueException: DirectoryIterator::__construct(http:/pspc.dyndns.info/~pspc/audio/2018-10-28_1528/,http:/pspc.dyndns.info/~pspc/audio/2018-10-28_1528/): The filename, directory name, or volume label syntax is incorrect. (code: 123) in 

0 个答案:

没有答案