Read directory and put specific filepaths in array
<p>Say I have a directory with the following files:</p>

<ul>
<li>a_1.csv</li>
<li>a.csv</li>
<li>b_1.csv</li>
<li>b.csv</li>
<li>something_else.csv</li>
</ul>

<p>Now I'd like to readdir() this directory and put all the files beginning with a (a.csv, a_1.csv) into array $a and all files beginning with b (b.csv and b_1.csv) into array $b. All the other files should be ignored, e.g. something_else.csv</p>

<p>I thought about iterating through the whole directory and preg_match'ing the filename, but I don't know if there's a faster way to do this?</p>
