how to get all the csv file name under a directory?
<p>supposed there is a folder named <code>example</code>, and in it there are some csv file eg<code>(a.csv, b.csv....</code>).</p>

<p>the <code>test.php</code> directory is the same as <code>example</code> folder.  now i want to pass all the csv file name to the following if condition. namely, replace <code>test.csv</code> with all the csv file name</p>

<pre><code>if (($handle = fopen("test.csv", "r"))
</code></pre>

<p>how do i do?</p>

<p>i using the following code:</p>

<pre><code>$files=  glob("./example/*.csv");
 if (($handle = fopen("$files", "r"))
</code></pre>

<p>but it doesn't work. thank you.</p>
