PHP Windows创建隐藏文件 [英] PHP windows create hidden files

查看:77
本文介绍了PHP Windows创建隐藏文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

推荐答案

如果Windows中的文件上设置了hidden属性,则该文件将被隐藏.没有内置函数可以执行此操作,因此您需要使用系统/

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));

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

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

这篇关于PHP Windows创建隐藏文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆