PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
There is already a 'search', since you only allow filenames that match the '*.txt' pattern...
Anyway, you could use eg: http://www.php.net/preg_match to see if the filename matches another pattern... (Or any other string function that allows you compare (specific) parts.)