我如何搜索/匹配文件名中的一组字符,例如3XYTPRQgz.pdf是文件名,我需要搜索'3XYTPRQ',然后如果找到此字符串我只想输出“作业完成”,如果不存在则将其设置为排队。 (我想为多个文件执行此操作)。
我对如何做到这一点的想法是,(我正在努力匹配字符串部分):
<?php
if(match("7digitnumber) //then < not sure what function to use any tips?
if file_exists($7digitnumber/filename)
{
echo "completed";
}
else
{
echo "queued";
}
?>
感谢您的帮助。