View Single Post
Old 06-28-2006, 08:01 AM   #1 (permalink)
markster
Code Monkey
 
markster's Avatar
 
Join Date: Jun 2006
Posts: 65
markster is on a distinguished road
Question How do I check if a file exists/delete a file?

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($i1000);
$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?
markster is offline   Reply With Quote