本文整理汇总了PHP中text::arrayToString方法的典型用法代码示例。如果您正苦于以下问题:PHP text::arrayToString方法的具体用法?PHP text::arrayToString怎么用?PHP text::arrayToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类text
的用法示例。
在下文中一共展示了text::arrayToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUri
private function getUri()
{
self::$URL = $_SERVER['HTTP_HOST'];
// $URI = str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['PHP_SELF']);
// var_dump($_SERVER['SCRIPT_NAME'], $_SERVER['PHP_SELF']);
$URI = $_SERVER['REQUEST_URI'];
list(self::$URN) = explode("?", $URI);
// remove '?'
self::$URI = self::$URL . self::$URN;
if (strlen(self::$URN) > 2 && substr(self::$URN, -1, 1) == "/") {
self::$URN = substr(self::$URN, 0, -1);
}
$arr = explode("/", substr(self::$URN, 1));
foreach ($arr as $val) {
self::$URNPart[] = $val;
}
list(self::$URL) = explode(":", self::$URL);
// remove ':' port
$arr = explode(".", self::$URL);
foreach ($arr as $val) {
self::$URLPart[] = $val;
}
self::$subdomain = implode(".", array_slice(self::$URLPart, 0, -2));
Log::log(self::CLASSNAME, 'URN: ' . self::$URN);
Log::log(self::CLASSNAME, 'URL: ' . self::$URL);
Log::log(self::CLASSNAME, 'URI: ' . self::$URI);
Log::log(self::CLASSNAME, 'URN parts: ' . text::arrayToString(self::$URNPart, true));
Log::log(self::CLASSNAME, 'URL parts: ' . text::arrayToString(self::$URLPart, true));
Log::log(self::CLASSNAME, 'Subdomain: ' . self::$subdomain);
}