Home > Backend Development > PHP Tutorial > PHP 删除局域网文件

PHP 删除局域网文件

WBOY
Release: 2016-06-23 14:19:53
Original
961 people have browsed it

PHP 远程访问 文件操作 局域网 path


    Public function actionRemove($Path) {
        $filePath = explode(",", $Path);   //分割字符串
        try {
            foreach ($filePath as $path) {  //循环
                $path = $this->encode($path);  //转码
           //exit($path)//如果这里放开,结果\\10.80.37.20\ECampus\shared_files\问题.txt
                if (strpos($path, ".")) {    //判断文件是否带. 文件,返true           
                  if (file_exists($path)) {  //问题在这里,总是返回false. ???????????
                        if (unlink($path)) {  //无法删除
                                 ......
                            } else {

                                   }
                    } else {
                        exit("2");
                    }
                } else {
                   exit("2");
                }
以上路径:\\10.80.37.20\ECampus\shared_files\问题.txt
用“运行” 开始键+R  可以直接打开。 
因为这是对远程文件的操作,所以需要有中文。
求高人帮忙解决,在线等。

回复讨论(解决方案)

你把局域?的文件?映射到本地磁???,linux下我??做????,windows下???

你把局域?的文件?映射到本地磁???,linux下我??做????,windows下???

我就是windows下的不行,
现在那个函数我该用@fopen($path, 'r') 来判断存在与否。
file_exists($path) //所以说这函数很奇怪。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template