我有一段代码:
foreach (glob('mov/$context.mov') as $filename){
$theData = file_get_contents($filename) or die("Unable to retrieve file data");
}
这是在该 glob 中添加变量的正确方法吗?$上下文
另外,在我的新文件中,我想用 $context 替换一个单词,所以我会写
$context = "word"; // so it adds that word to the glob function when the script is included in a different file.