I need to use a preg_match to get a file that matches a certain condition. For example, I want to find a file named “123-stack-overflow.txt”. There can be any characters after the 123- and before the .txt.
How can this be modified so it will work?
preg_match("/^$ID-(.+).txt/" , $name, $file);
Regexp
^123-.+\.txt$php: