我正在尝试这样做:
$filename = "/destination/destination2/file_*";
"* "= 任何内容
目标 2 文件:
file_somethingrandom
因为它 $filename 包含 * 所以它应该选择 file_somethingrandom
怎么做?
最佳答案
使用 glob()
像这样的功能:
$filename = "/destination/destination2/file_*";
foreach (glob($filename) as $filefound)
{
echo "$filefound size " . filesize($filefound) . "\n";
}
关于php - 如何让 PHP 查找包含某些内容的文件名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9943240/