PHP/File Directory/File Open
Версия от 10:37, 26 мая 2010; (обсуждение)
Checking That a File Exists
<?php
$myfile = "./test.txt";
if (file_exists ($myfile)){
$msg="File already exists. ";
}else{
$myfile = @fopen ($myfile, "w+") or die ("Couldn"t create the file" );
$msg= "File created! " ;
fclose ($myfile);
}
echo "$msg";
?>