What should I do if php unlink cannot be deleted?

藏色散人
Release: 2023-03-08 17:08:01
Original
2711 people have browsed it

php unlink cannot be deleted because fclose is not executed. The solution is: first create a PHP sample file; then open the file through fopen; then close the file through "fclose($fp);"; and finally delete it through unlink Just file.

What should I do if php unlink cannot be deleted?

The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer

php encountered the problem that unlink cannot delete files today

//打开文件
$fp = fopen(文件名路径,'r');
......
//注意关闭文件
fclose( $fp );
//再删除文件
unlink( 文件名路径 );
Copy after login

I forgot about fclose, so I never deleted the files, dizzy...

[Recommended learning: "PHP Video Tutorial"]

The above is the detailed content of What should I do if php unlink cannot be deleted?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!