toArray() AS $listColumn => $listValue) { $listValue = str_replace("/", "*", $listValue); $listValue = str_replace(" ", "*", $listValue); $pattern = str_replace("{". $listColumn ."}", $listValue, $pattern); } $fullPath = "storage/documents/" . $columnArray['path'].$pattern; $search = glob($fullPath, GLOB_BRACE); if(count($search)>0) { ?>