PHP Filehandling, code never reached
<p>I've got a piece of code with some error i've been trying to find all day... what this (should) does is: go through all the files in a folder, check if it's a image type, if it is, create a thumbnail in some folder. It does the job BUT: it doesnt continue afterwards, I put a echo command and its never executed. I apprechiate any help! thanks alot.</p>

<pre><code>$bilddateitypen     = array('gif','jpg','JPG','GIF');

$importdir          = '../sync';
if ($handle = opendir($importdir)) {
    while (($file = readdir($handle)) !== false) {
        if (!is_dir($importdir."/".$file) &amp;&amp; is_file($importdir."/".$file)) {
            $ex = explode('.',$file);
            if(in_array($ex[count($ex)-1], $bilddateitypen)) {

                $file = utf8_decode($file);
                $thumbnail = new thumbnail($importdir."/".$file);
                $thumbnail-&gt;jpeg_quality(93);
                $thumbnail-&gt;save("../shop/images/product_images/original_images/".$file);
                $thumbnail-&gt;size_auto(500);
                $thumbnail-&gt;save("../shop/images/product_images/popup_images/".$file);
                $thumbnail-&gt;size_auto(200);
                $thumbnail-&gt;save("../shop/images/product_images/info_images/".$file);
                $thumbnail-&gt;size_auto(112);
                $thumbnail-&gt;save("../shop/images/product_images/thumbnail_images/".$file);


            } else {
                continue;   
            }
        }
    }
    closedir($handle);
}
echo "Hallo Welt";
</code></pre>
