Using a wildcard in php unlink
问题 I am currently making a php script to graph a bunch of data from a DB, arrange it into text files and then run a GNUPlot script to generate graphs. I have all of this working , now all I need to do is delete the text files I don't need anymore. What I have been trying was gotten from another thread on a different forum: foreach( glob('US_A.2.6.*') as $file ) { unlink($file); } The problem, however, is that it doesn't work. The files have complex end names: US_A.2.6.1.1a.txt US_A.2.6.1.2a.txt