如何在特定目录中创建文件?
目前我的代码如下:
I have also tried fopen but that didn't work :(
Thanks for all the help guy :) really appreciated.
目前我的代码如下:
$username = $_POST["username"];
$filedir = "./u/".$username;
mkdir($filedir);
$folder = $filedir;
chmod($filedir, 0777);
$createfile = fopen( $_SERVER['DOCUMENT_ROOT'] . '/path/filename.php' );
I have also tried fopen but that didn't work :(
我懂了!!!它是
$createfile = fopen('./u/'.$username.'/'.$username.'.php', 'x');
Thanks for all the help guy :) really appreciated.
$createfile = fopen( $_SERVER['DOCUMENT_ROOT'] . '/u/'.$username.'/filename.php' );
代替。 - Charlotte Dunois$createfile = fopen( $_SERVER['DOCUMENT_ROOT'] . '/u/'.$username.'/filename.php', 'w+');
- Charlotte Dunois