PHP窗口创建隐藏文件

Tid*_*ddo 4 php windows hidden file

是否可以使用php(xampp)在Windows上创建隐藏文件/文件夹?如果是的话,怎么样?

ale*_*exn 9

如果Windows中的文件设置了隐藏属性,则会隐藏该文件.没有内置函数来执行此操作,因此您需要使用system/exec来执行attrib应用程序.像这样:

$file = 'test.txt';
system('attrib +H ' . escapeshellarg($file));
Run Code Online (Sandbox Code Playgroud)

这将在test.txt上设置隐藏(+ H)标志.