<?php

$directory = 'assets/uploads/gallery';
$images = array();

if (is_dir($directory)) {
    $files = glob($directory . '/*.{jpg,jpeg,png,gif,webp}', GLOB_BRACE);
    
    foreach ($files as $file) {
        $relativePath = str_replace('..', '', $file); // Remove parent directory notation
        $images[] = $relativePath;
    }
}



function getImages() {
    global $images;
    return $images;
}