WordPress\AiClientDependencies\Psr\Http\Message
UriInterface::__toString
Return the string representation as a URI reference.
Depending on which components of the URI are present, the resulting string is either a full URI or relative reference according to RFC 3986, Section 4.1. The method concatenates the various components of the URI, using the appropriate delimiters:
- If a scheme is present, it MUST be suffixed by ":".
- If an authority is present, it MUST be prefixed by "//".
- The path can be concatenated without delimiters. But there are two cases where the path has to be adjusted to make the URI reference valid as PHP does not allow to throw an exception in __toString():
- If the path is rootless and an authority is present, the path MUST be prefixed by "/". - If the path is starting with more than one "/" and no authority is present, the starting slashes MUST be reduced to one.
- If a query is present, it MUST be prefixed by "?".
- If a fragment is present, it MUST be prefixed by "#".
Method of the class: UriInterface{}
No Hooks.
Returns
String.
Usage
$UriInterface = new UriInterface(); $UriInterface->__toString(): string;
Notes
UriInterface::__toString() UriInterface:: toString code WP 7.0
public function __toString(): string;