2010-07-05 38 views

回答

5

我不不知道关于wordpress

但在PHP中,你想要glob逗号nd - http://php.net/glob

+0

谢谢,但我得到的服务器文件路径。有什么办法我只能得到短文件名? – Alex 2010-07-05 22:32:10

+0

http://php.net/basename – James 2010-07-06 07:20:13

4

使用glob像这样得到的所有.css文件的文件名:

$file_paths = glob('/path/to/files/*.extension'); 
3

退房的glob功能

$files=glob("/path/to/your/folder/*.css"); 
foreach ($files as $file) { 
    echo "$file<br>"; 
}