I'm trying to create a file using PHP but the problem is that the needed file has no name but only an extension. How can I do it? The present code just doesn't make the file but it also doesn't give me an error.
fopen( '.extension', 'w' )or die( 'ERROR MESSAGE' );
Files with only an extension and no name are treated as hidden in unix. To list them, you might call ls -la
inside the terminal.
So the code you posted should just work fine. Note: you should always close the file opend with fopen
!
$f = fopen( '.extension', 'w' );
if ($f) {
fclose($f);
}