Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //getFiles('./');
- function getFiles($dir) {
- $files = array_diff(scandir($dir), array('.','..'));
- foreach ($files as $file) {
- if (is_dir($dir . $file)) {
- getFiles($dir . $file . '/');
- }
- else {
- //echo $dir . $file . "<br />";
- $type = explode('.', $file);
- $type = $type[count($type) - 1];
- if ($type == 'jpg' || $type == 'png' || $type == 'jpeg' || $type == 'gif') {
- echo '<image src="' . $dir . $file . '" />';
- }
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement