$ourFileName = "testFile.txt";
$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
fclose($ourFileHandle);
The file "testFile.txt" should be created in the same directory where this PHP code resides.Now is there any method to create this file in some other folder. I tried something like this -
$ourFileName = "http://abc.com/folder1/folder2/testFile.txt";
$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
But it did not work.