Press "Enter" to skip to content

Touching a file using PHP

Using php to create or touch a file, first checks to see if it already exists.

[code]
< ?php //set the filename or passed from form argument $filename = "/path/filenane.ext"; //does the file exist? if (!file_exists($filename)) { //create the filename touch($filename); //set permissions chmod($filename,666); } ?>
[/code]