[英]PHP glob function to match directories but not files
I am trying to use the PHP function glob()
to match directories, not files . 我正在尝试使用PHP函数
glob()
来匹配目录,而不是文件 。 I can get it to match all folders using glob('*')
, but that matches files also. 我可以使用
glob('*')
来匹配所有文件夹,但是也可以匹配文件。 I can match all files using glob(*.*)
, but that's not what I want. 我可以使用
glob(*.*)
匹配所有文件,但这不是我想要的。
Is there a way to subtract perameters from the glob()
matching system, or should I use preg_match()
to limit the results? 有没有办法从
glob()
匹配系统中减去性能参数,还是应该使用preg_match()
来限制结果?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.