1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18: | <?php
$verzeichnis = "bilder/bilder/Kiel/";
$array_types = array('jpg' , 'png');
$dir = opendir("$verzeichnis");
while (($file = readdir($dir)) != false) {
if (preg_match("/^index/", $file)) continue;
if (preg_match("/..?$/", $file)) continue;
foreach($array_types as $typ) {
if (preg_match("/.".$typ."$/i", $file)) $dateien[] = $file;
};
};
$zufall = array_rand($dateien);
$bild = "$dateien[$zufall]";
$size = @getimagesize("$verzeichnis"."$bild");
$breite = $size[0];
$hoehe = $size[1];
echo "<img src=\"$verzeichnis$bild\" width=\"$breite\" height=\"$hoehe\" border=\"0\">";
?> |