php delete files

The unlink (filename, context) 
filename: Required. The provisions of files to be deleted.
context: Optional. File handles environmental regulations. Context is to modify the behavior of a stream option.
First determine whether the general file_exists () file exists

1. No release variables, resulting in not delete permissions; unset ($ info);
2. Open the file pointer is not closed; fclose ($ handle);
less than 3 disk file,
A .linux operating system, modify the permissions 777;
b.windows system give everyone, and for everyone to read and write all permissions;
c.php modify permissions chmod ($ filename, 0777); 

 

Guess you like

Origin www.cnblogs.com/ziyandeyanhuo/p/11244641.html