如何使用 PHP 列出 Windows 共享的内容?
$SearchFolder = "\\\\192.168.1.100\\pdfoutput\\";
if (is_dir($SearchFolder))
{
if ($Directory = opendir($SearchFolder))
{
while (($File = readdir($Directory)) !== false)
{
if(filetype($SearchFolder.$File) == "file")
{
$this->Attachments[] = new Attachment($SearchFolder.$File);
}
}
closedir($Directory);
}
}
打印(opendir($SearchFolder)); 给出这个错误:
警告:opendir(\192.168.1.100\pdfoutput) [function.opendir]: failed to open dir: No error in C:\Users\gary\Webserver\QuickMail\maildetails.php on line 227
这没有按预期工作。有什么想法吗?