-
-
Save illuzor/97ddfd5d29294c1b8b6113742cc96fc1 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 | |
$gallery = $_GET["gallery"]; | |
if (!$gallery) { | |
echo "{'error':'Empty parameter', 'code':0}"; | |
} else { | |
$folder_path = "images/" . $gallery; | |
if (is_dir($folder_path)) { | |
$images = array_diff(scandir($folder_path, 1), array('.', "..")); | |
echo json_encode($images, false); | |
} else { | |
echo "{'error':'The folder is not exist', 'code':1}"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment