stop double extension uplaod
<p>hey i'm trying to verify if the user trying to upload a double extension file so for that i'm using the following code </p>

<pre><code>function ExtensionValide($sFileName) {

        $fileNameInfo = array();
        if (preg_match('/.php.|.js./',$sFileName)) {
            return false;   # Tentative de masquer des extensions dangereuses !
        }
        else {
            $extension_valide = array('gif','png','jpg','jpeg','txt','pdf','html','mp3','csv');
            $extension_upload = strtolower(substr(strrchr($sFileName,'.'),1));
            $fileNameInfo[0] = in_array($extension_upload,$extension_valide);
            $fileNameInfo[1] = ".$extension_upload";
            $fileNameInfo[2] = basename($sFileName,$fileNameInfo[1]);
            return $fileNameInfo;
        }
    }
</code></pre>

<p>but the problem still that the user can uplaod .PHP.png with a capital letter so i'm trying to find if there is any regular expression that can handle the thnig in <code>preg_match('/.php.|.js./',$sFileName)</code> i want to say <code>preg_match('/.any_string./',$sFileName)</code> how can i do that </p>