Delete Lan files in PHP

Source: Internet
Author: User
PHP deletes Lan files PHP remote access file operations Lan path


Public function actionRemove ($ Path ){
$ FilePath = explode (",", $ Path); // split the string
Try {
Foreach ($ filePath as $ path) {// Loop
$ Path = $ this-> encode ($ path); // transcode
// Exit ($ path) // If you open it here, the result \ 10.80.37.20 \ ECampus \ shared_files \ question .txt
If (strpos ($ path, ".") {// checks whether the file contains a. file, returns true
If (file_exists ($ path) {// The problem is always returned here, false .???????????
If (unlink ($ path) {// cannot be deleted
......
} Else {

}
} Else {
Exit ("2 ");
}
} Else {
Exit ("2 ");
}
Above path: \ 10.80.37.20 \ ECampus \ shared_files \ question .txt
Use the "run" start key + R to open it directly.
Because this operation is performed on remote files, Chinese characters are required.
Ask someone else to help solve the problem and wait online.


Reply to discussion (solution)

What do you want to do with the local area? ? ING to local magnetic ???, In linux, I ?? Do ????, In windows ???

What do you want to do with the local area? ? ING to local magnetic ???, In linux, I ?? Do ????, In windows ???

I am in windows,
Now I should use @ fopen ($ path, 'r') to determine whether the function exists or not.
File_exists ($ path) // so this function is strange.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.