Create a New File in PHP:
<?php
$filename = “e:/ashu.txt”;
if(file_exists($filename))
{
$msg = “file already exists”;
}
else
{
$newfile = fopen($filename, “w+”) or die(“Unable to create file”);
fclose($newfile);
$msg = “<p>file created</p>”;
}
?>
<html>
<head>
<title>
Creating a new file
</title>
</head>
<body>
<? echo $msg; ?>
</body>
</html>