Created
June 9, 2014 15:00
-
-
Save magicznyleszek/26dc0d263f252cd6dc93 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function obrazki($tag) { | |
$dir = './images/foto'; | |
if (is_dir($dir)) { | |
if ($dir_open = opendir($dir)) { | |
while ($file = readdir($dir_open)) { | |
if ($file == "." || $file == "..") continue; | |
$file_tag = substr($file,0,strlen($file)-7); | |
if ($file_tag == $tag) $tab[] = $file; | |
} | |
asort($tab); | |
} | |
closedir($dir_open); | |
} | |
foreach ($tab as $value) { | |
echo '<img src="images/foto/'.str_replace(".","_m.",$value).'">'."\n"; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment