Skip to content

Instantly share code, notes, and snippets.

@Niduroki
Created May 27, 2013 22:21
Show Gist options
  • Save Niduroki/5659360 to your computer and use it in GitHub Desktop.
Save Niduroki/5659360 to your computer and use it in GitHub Desktop.
Picture testing
<?php
function ls($directory) {
$result = array();
$handler = opendir($directory);
while ($file = readdir($handler)) { if ($file !== "." and $file !== "..") { $result[] = $file; } }
closedir($handler);
return $result;
}
?>
<!DOCTYPE html>
<html>
<head><title>Picture-test</title></head>
<body style="background-color: #aaa; text-align: center;">
<?php
$core_css_images = ls("core/css/images/");
$core_img_actions = ls("core/img/actions/");
$core_img_places = ls("core/img/places/");
$core_img_rating = ls("core/img/rating/");
$core_img = ls("core/img/");
$settings_img = ls("settings/img/");
foreach($core_css_images as $image) {
echo('<img src="/core/css/images/'.$image.'"><br><br>');
}
echo("<hr>");
foreach($core_img_actions as $image) {
echo('<img src="/core/img/actions/'.$image.'"><br><br>');
}
echo("<hr>");
foreach($core_img_places as $image) {
echo('<img src="/core/img/places/'.$image.'"><br><br>');
}
foreach($core_img_rating as $image) {
echo('<img src="/core/img/rating/'.$image.'"><br><br>');
}
echo("<hr>");
foreach($core_img as $image) {
echo('<img src="/core/img/'.$image.'"><br><br>');
}
echo("<hr>");
foreach($settings_img as $image) {
echo('<img src="/settings/img/'.$image.'"><br><br>');
}
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment