Purl\Url::getNetloc PHP Метод

getNetloc() публичный Метод

Gets the netloc part of the Url. It is the user, pass, host and port returned as a string.
public getNetloc ( ) : string
Результат string
    public function getNetloc()
    {
        $this->initialize();
        return ($this->user && $this->pass ? $this->user . ($this->pass ? ':' . $this->pass : '') . '@' : '') . $this->host . ($this->port ? ':' . $this->port : '');
    }

Usage Example

Пример #1
0
 public function testGetNetloc()
 {
     $url = new Url('https://*****:*****@jwage.com:443');
     $this->assertEquals('user:[email protected]:443', $url->getNetloc());
 }