Display files from a specific folder in same order
<p>I am trying to display files from a filesystem in a html format in the <strong>same order</strong>.</p>

<p>I got a file name like this and it looks like this in the folder structure:</p>

<pre><code>ABC_100_name.pdf
ABC_101_name.pdf
ABC_102_name.pdf
ABC_102A1_name.pdf
ABC_103_name.pdf
ABC_103A1_name.pdf
ABC_104_name.pdf
</code></pre>

<p>I am using <code>scandir()</code> without any sort parameters.
The result I get is:</p>

<pre><code>ABC_100_name.pdf
ABC_101_name.pdf
ABC_102A1_name.pdf
ABC_102_name.pdf
ABC_103A1_name.pdf
ABC_103_name.pdf
ABC_104_name.pdf
</code></pre>

<p>Neither <code>sort()</code> nor other <code>sort-functions</code> seem to help me with this.
What am I getting wrong?</p>

<hr>

<p>The array I get from <code>scandir()</code> is:</p>

<pre><code>array(5) { 
[0]=&gt; string(1) "." 
[1]=&gt; string(2) ".." 
[2]=&gt; string(16) "ABC_100_name.pdf" 
[3]=&gt; string(18) "ABC_101A1_name.pdf" 
[4]=&gt; string(16) "ABC_101_name.pdf" }
</code></pre>