array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'it', ), 'this' => array ( 0 => 'uri-whatwg-url.construct.php', 1 => 'Uri\\WhatWg\\Url::__construct', 2 => 'Construct the Url object', ), 'up' => array ( 0 => 'class.uri-whatwg-url.php', 1 => 'Uri\\WhatWg\\Url', ), 'prev' => array ( 0 => 'class.uri-whatwg-url.php', 1 => 'Uri\\WhatWg\\Url', ), 'next' => array ( 0 => 'uri-whatwg-url.debuginfo.php', 1 => 'Uri\\WhatWg\\Url::__debugInfo', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/uri/uri/whatwg/url/construct.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

Uri\WhatWg\Url::__construct

(PHP 8 >= 8.5.0)

Uri\WhatWg\Url::__constructConstruct the Url object

Descrizione

public Uri\WhatWg\Url::__construct(string $uri, ?Uri\WhatWg\Url $baseUrl = null, array &$softErrors = null)

Constructs the Uri\Rfc3986\Uri object.

Elenco dei parametri

uri
A valid URL string to parse (e.g. /foo or (e.g. https://example.com/foo).
baseUrl
When a string is passed, uri is applied on baseUrl, if uri is a relative-URL string. If either null is passed, or uri is a not a relative-URL string, then baseUrl doesn't have any effect.
softErrors
An array to pass a list of Uri\WhatWg\UrlValidationError instances by reference to provide extended information about the errors triggered during parsing.

Errori/Eccezioni

If the resulting URL is invalid, a Uri\WhatWg\InvalidUrlException is thrown.

Vedere anche: