Source Code : Using file_exists, touch, and unlink together
PHP Is Open Source Programming Language You Can Download and use It, You required xampp server and wamp server . You download From xampp server from https://www.apachefriends.org/download.html.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://php.net/.
Click Here or search from google with Libraries Name you get jar file related it and also http://php.net/ is a official site
Using file_exists, touch, and unlink together
<?php
$file_name="test.txt";
if(file_exists($file_name)) {
echo ("$file_name does exist.<br />");
}
else {
echo ("The file $file_name does not exist.<br />");
touch($file_name);
}
if(file_exists($file_name)) {
echo ("The file $file_name does exist.<br />");
unlink($file_name);
}
else {
echo ("The file $file_name does not exist.<br />");
}
if(file_exists($file_name)) {
echo ("The file $file_name does exist.<br />");
}
else {
echo ("The file $file_name does not exist.<br />");
}
?>
Thank with us