function prevPath(bool $isPath = true) : string { if (!isset($_SERVER['HTTP_REFERER'])) { return false; } $str = str_replace(sslStatus() . host() . BASE_DIR . indexStatus(), '', $_SERVER['HTTP_REFERER']); if (currentLang()) { $str = explode("/", $str); return $str[1]; } if ($isPath === true) { return $str; } else { $str = explode("/", $str); $count = count($str); if ($count > 1) { return $str[$count - 1]; } return $str[0]; } }
function prevPath($isPath = true) { if (!is_bool($isPath)) { $isPath = true; } $str = str_replace(sslStatus() . host() . BASE_DIR . indexStatus(), '', server("referer")); if (currentLang()) { $str = explode("/", $str); return $str[1]; } if ($isPath === true) { return $str; } else { $str = explode("/", $str); $count = count($str); if ($count > 1) { return $str[$count - 1]; } return $str[0]; } }
function hostUrl(string $uri = '') : string { return sslStatus() . suffix(host()) . internalCleanInjection($uri); }