how to get case insensitive matching with in_array?
<p>if we have  </p>

<pre><code>$allowimg = array('gif','bmp','jpg','png','jpeg','tif','tiff','tga','psd');
</code></pre>

<p>and want to make upload center with it if we put this code  </p>

<pre><code>if(in_array($filetype,$allowimg)){
//pic
$error = 0;
$filedoc = 'pic';
}
else{ echo 'bad file type!';}
</code></pre>

<p>if user upload my.PNG<br>
its run Else cuz PNG is not == png for php<br>
can anyone help me with this?<br>
and how to secure from file uploads?  </p>

<pre><code>$filename = explode('.',$nn);
</code></pre>

<p>is ok? so what if user upload<br>
my.pic.jpg?</p>
