Jonas Dinkelmann: PHP Bildergallerie

Beitrag lesen

Hallo zusammen
Ich hab ein kleines Problem mit folgendem Code:
<?
$uploaddir = "includes/inhalt/j_pics/";
$erlaubteEndungen = ".gif,.jpg,.png";

$x = 0;
if ($handle = opendir($uploaddir)) {
   while ($bild = readdir($handle)) {
     $bildtyp = strrchr($bild, ".");
  if($bildtyp)$bildtyp = strtolower($bildtyp);
  $typerlaubt = strpos($erlaubteEndungen, $bildtyp);
     if ($bild != "." && $bild != ".." && $typerlaubt === true){
      $array[$x] = $bild;
   $x++;
    }
   }
   closedir($handle);
}
?>