PHP windows create hidden files
问题 Is it possible to create hidden files/folders on windows using php (xampp)? And if it is, how? 回答1: 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. 回答2: You could call attrib: $filename = 'c:\\some\\file.txt'; exec('attrib +h '.$filename);