Skip to content

Uri: withScheme Example

Terry L edited this page Jun 20, 2020 · 3 revisions

Shieldon\Psr7\Uri

withScheme($scheme)

Return an instance with the specified scheme.

  • param string scheme * The scheme to use with the new instance.
  • return static

Example:

echo $uri->getScheme();
// Outputs: https

$url = $uri->withScheme('http');

echo $uri->getScheme();
// Outputs: http
Clone this wiki locally