URL

php\net\URL

Class URL

Methods


__construct($uri)
Parameters:
  • $uristring
openConnection($proxy)
Parameters:
Returns:

php\net\URLConnection

getAuthority()

Gets the authority part of this URL

Returns:string
getPort()
Returns:int
getDefaultPort()

Gets the default port number of the protocol associated with this URL. If the URL scheme or the URLStreamHandler for the URL do not define a default port number, then -1 is returned.

Returns:int
getProtocol()

Gets the protocol name of this URL

Returns:string
getHost()
Returns:string
getFile()

Gets the file name of this <code>URL</code>. The returned file portion will be the same as getPath(), plus the concatenation of the value of getQuery(), if any. If there is no query portion, this method and getPath() will return identical results.

Returns:string
getPath()
Returns:string
getQuery()
Returns:string
getRef()

Gets the anchor (also known as the “reference”) of this URL

Returns:string
sameFile($url)

Compares two URLs, excluding the fragment component.

Parameters:
Returns:

bool

toString()
Returns:string
toExternalForm()

Constructs a string representation of this URL. The string is created by calling the toExternalForm method of the stream protocol handler for this object.

Returns:string
openStream()
Returns:php\io\Stream
__toString()
Returns:string