Skip to content

Instantly share code, notes, and snippets.

@magicznyleszek
Created June 9, 2014 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save magicznyleszek/26dc0d263f252cd6dc93 to your computer and use it in GitHub Desktop.
Save magicznyleszek/26dc0d263f252cd6dc93 to your computer and use it in GitHub Desktop.
<?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