function load_first($value) { $value = array_unique($value); // just in case there are duplicates return array_merge(preg_grep('/vaultpress\\.php$/', $value), preg_grep('/vaultpress\\.php$/', $value, PREG_GREP_INVERT)); }