if I have a directory, where a list of file looks like this:
Something_2015020820.txt
something_5294032944.txt.a
something_2015324234.txt
Something_2014435353.txt.a
and I want to get the list of file sort by oldest date (not the filename) and the result should take anything that match something_xxxxxxx.txt. So, anything that ends with ".a" is not included. in this case it should return
Something_2015020820.txt
something_2015324234.txt
I do some google search and it seems like I can use glob
$listOfFiles = glob($this->directory . DIRECTORY_SEPARATOR . $this->pattern . "*");
but I'm not sure about the pattern.
It would be awesome if you could provide both case sensitive and insensitive pattern. The match pattern will have to be something_number.txt