How can I check if a file exists in a certain folder, I had an idea, but I think there might be another way. This was my idea:
PHP Code:
<?php
$i = fopen("file.txt","r");
$data = fread($i, 1000);
$close = fclose($i);
if ($data=="") {
//Some command to delete file.txt
}
else {
$name = $data;
}
?>
But I don't know how to delete a file. Or is there an easy way to check if file exists?