检查网络驱动器是否映射为 php


Check if network drive is mapped php

php 是否允许您检查网络驱动器是否已映射。基本上在所有计算机上,我们的 G:''驱动器已映射。是否可以使用 php 脚本来检查 G:''驱动器已映射?为了从映射驱动器访问目录和文件,我使用 UNC 名称。

非常感谢帮助

为什么要

使用 php 来访问客户端路径?file_exists也应该有效,但我不明白:)

<?php
$mydir = "G:' ";
echo file_exists($mydir) ? "G is mounted":"G is not mounted";
?>