private function cleanHostName(ServerRequestInterface $request)
    {

        if (is_null($this->baseHost)) {
            $hostname = $request->getUri()->getHost();
        } else {
            $hostname = str_replace($this->baseHost, "", $request->getUri()->getHost());
        }

        if (substr($hostname, -1) == ".") {
            $hostname = substr($hostname, 0, -1);
        }

        return $hostname;
    }
private function cleanHostName(ServerRequestInterface $request)
    {

        if (is_null($this->baseHost)) {
            $hostname = $request->getUri()->getHost();
        } else {
            $hostname = str_replace($this->baseHost, "", $request->getUri()->getHost());
        }

        if (substr($hostname, -1) == ".") {
            $hostname = substr($hostname, 0, -1);
        }

        return $hostname;
    }
private function cleanHostName ( ServerRequestInterface $ request ) { if ( is_null ( $ this -> baseHost ) ) { $ hostname = $ request -> getUri ( ) -> getHost ( ) ; } else { $ hostname = str_replace ( $ this -> baseHost , "" , $ request -> getUri ( ) -> getHost ( ) ) ; } if ( substr ( $ hostname , - 1 ) == "." ) { $ hostname = substr ( $ hostname , 0 , - 1 ) ; } return $ hostname ; }
will get hostname, and clean basehost off it

@param ServerRequestInterface $request
@return string
will get hostname and clean basehost off it