Why is scandir() returning false for directories?
<p>I have a directory named <code>client_images</code> that has <code>dir_1</code>, <code>dir_2</code> and <code>dir_3</code> as subdirectories.  When i run the following:</p>

<pre><code>foreach(scandir("client_images") as $key =&gt; $value ){
    if(is_dir($value)){
        echo $value." is a dir.&lt;br&gt;";
    }
    else{
        echo $value." is not a dir.&lt;br&gt;";
    }
}
</code></pre>

<p>i get :</p>

<blockquote>
<pre><code>. is a dir.
.. is a dir.
dir_1 is not a dir.
dir_2 is not a dir.
dir_3 is not a dir.
</code></pre>
</blockquote>

<p>Why is php returning false for directories?</p>
