create table

This commit is contained in:
xiaomlove
2021-01-22 01:58:28 +08:00
parent 4c9a4fc463
commit cf044448c7
2 changed files with 31 additions and 2 deletions

View File

@@ -385,3 +385,30 @@ function arr_set(&$array, $key, $value)
return $array;
}
function getSchemaAndHttpHost()
{
$isHttps = !empty($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) !== 'off');
$protocol = $isHttps ? 'https' : 'http';
$port = $_SERVER['SERVER_PORT'];
$result = "$protocol://" . $_SERVER['HTTP_HOST'];
if ($port != 80) {
$result .= ":$port";
}
return $result;
}
function getBaseUrl()
{
$url = getSchemaAndHttpHost();
$requestUri = $_SERVER['REQUEST_URI'];
$pos = strpos($requestUri, '?');
if ($pos !== false) {
$url .= substr($requestUri, 0, $pos);
} else {
$url .= $requestUri;
}
return $url;
}