PHP - Open or copy a file when knowing only part of its name?
问题 I have a huge repository of files that are ordered by numbered folders. In each folder is a file which starts with a unique number then an unknown string of characters. Given the unique number how can i open or copy this file? for example: I have been given the number '7656875' and nothing more. I need to interact with a file called '\server\7656800\7656875 foobar 2x4'. how can i achieve this using PHP? 回答1: If you know the directory name, consider using glob() $matches = glob('./server/dir/'