fetchArray($query); $results = []; foreach ($rs as $r) { $result = []; foreach ($custom as $key => $value) { $result[$key] = $r[$value]; } $results[] = $result; } return $results; } private static function getFileValues($file, $resource, $elements = [], $search = null) { $superselect = self::getSelectInfo(); $where = []; $filter = []; $search_fields = []; $custom = [ 'id' => 'id', 'text' => 'descrizione', ]; require $file; if (!isset($results) && !empty($query)) { $results = self::completeResults($query, $where, $filter, $search_fields, $custom); } return $results; } private static function getSelectInfo() { return !empty($_SESSION['superselect']) ? $_SESSION['superselect'] : []; } }