Home >> PHP >> Destroy the file in PHP

Destroy the file in PHP

The unlink() function used to destroy the file.

Example

if(file_exits("abc.txt")){

      unlink("abc.txt");

      echo "file has been destroyed";

}else{

       echo "file not found";

}

Post Your Comment

Next Questions
Write into the file
Create into folder
Remove a folder
touch() function
file_exits() function
unlink() function
fwrite() function
mkdir() function
rmdir() function
is_dir() function
file_get_contents() function
fgets() function
basename() function
chgrp() function
chmod() function
chown() function
clearstatcache() function
copy() function
delete() function
dirname() function
disk_free_space() function
disk_total_space() function
diskfreespace() function
feof() function
fflush() function

Copyright ©2022 coderraj.com. All Rights Reserved.