Skip to content

Instantly share code, notes, and snippets.

@runezero
Last active October 11, 2022 21:21
Show Gist options
  • Save runezero/03384c094b0fffb18323da7d268b0b70 to your computer and use it in GitHub Desktop.
Save runezero/03384c094b0fffb18323da7d268b0b70 to your computer and use it in GitHub Desktop.
[Serve images from site] Print the image links from a directory #tools
<?php
$id = $_GET['id'];
$path = getcwd() .'/' . $id . "/";
$files = scandir($path);
foreach($files as $key => $file){
if($file == "." || $file == ".."|| $file == "original"){
continue;
}
if($key != 2){
echo ",";
}
echo "https://domain.nl/directory/" . $id . "/" . $file;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment