PHP windows create hidden files

前端 未结 3 962
孤独总比滥情好
孤独总比滥情好 2021-01-06 09:16

Is it possible to create hidden files/folders on windows using php (xampp)? And if it is, how?

3条回答
  •  长情又很酷
    2021-01-06 09:55

    A file in Windows is hidden if it has the hidden attribute set on it. There is no built in function to do this, so you need to use system/exec to execute the attrib application. Like this:

    $file = 'test.txt';
    system('attrib +H ' . escapeshellarg($file));
    

    This will set the hidden (+H) flag on test.txt.

提交回复
热议问题