Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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