read gif files?

kaits

Mitglied
how to read only all gif formated files from a directory and show them on the page separated by <br>

picture1
picture2
...




and feel free to answer in German ;)
 
PHP:
<?
$dir = "."; 
$verz=opendir ($dir);
    while ($file = readdir ($verz)) {
				if (substr($file, -3) == "gif") {
					echo "<img src=\"$dir."/".$file\"><br>";
				}
	}
closedir($verz);
?>

[edit]
Now it finally works.
[/edit]
 
Zuletzt bearbeitet:
Zurück