<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.uri-rfc3986-uri.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'uri-rfc3986-uri.withhost.php',
    1 => 'Uri\\Rfc3986\\Uri::withHost',
    2 => 'Modify the host component',
  ),
  'up' => 
  array (
    0 => 'class.uri-rfc3986-uri.php',
    1 => 'Uri\\Rfc3986\\Uri',
  ),
  'prev' => 
  array (
    0 => 'uri-rfc3986-uri.withfragment.php',
    1 => 'Uri\\Rfc3986\\Uri::withFragment',
  ),
  'next' => 
  array (
    0 => 'uri-rfc3986-uri.withpath.php',
    1 => 'Uri\\Rfc3986\\Uri::withPath',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/uri/uri/rfc3986/uri/withhost.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="uri-rfc3986-uri.withhost" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Uri\Rfc3986\Uri::withHost</h1>
  <p class="verinfo">(PHP 8 &gt;= 8.5.0)</p><p class="refpurpose"><span class="refname">Uri\Rfc3986\Uri::withHost</span> &mdash; <span class="dc-title">Modify the host component</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-uri-rfc3986-uri.withhost-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Uri\Rfc3986\Uri::withHost</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$host</code></span>): <span class="type">static</span></div>

  <p class="simpara">
   Creates a new URI and modifies its host component.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-uri-rfc3986-uri.withhost-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <dl>
   
    <dt><code class="parameter">host</code></dt>
    <dd>
     <span class="simpara">
      New host component.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-uri-rfc3986-uri.withhost-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="simpara">
   The modified <span class="classname"><a href="class.uri-rfc3986-uri.php" class="classname">Uri\Rfc3986\Uri</a></span> instance.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-uri-rfc3986-uri.withhost-errors">
  <h3 class="title">Errori/Eccezioni</h3>
  
  <p class="simpara">
   If the resulting URI is invalid, a <span class="exceptionname"><a href="class.uri-invaliduriexception.php" class="exceptionname">Uri\InvalidUriException</a></span> is thrown.
  </p>

 </div>


 <div class="refsect1 examples" id="refsect1-uri-rfc3986-uri.withhost-examples">
  <h3 class="title">Esempi</h3>
  <div class="example" id="uri-rfc3986-uri.withhost.example.basic">
   <p><strong>Example #1 <span class="methodname"><strong>Uri\Rfc3986\Uri::withHost()</strong></span> basic example</strong></p>
   <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$uri </span><span style="color: #007700">= new </span><span style="color: #0000BB">\Uri\Rfc3986\Uri</span><span style="color: #007700">(</span><span style="color: #DD0000">"https://example.com"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$uri </span><span style="color: #007700">= </span><span style="color: #0000BB">$uri</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">withHost</span><span style="color: #007700">(</span><span style="color: #DD0000">"example.net"</span><span style="color: #007700">);<br /><br />echo </span><span style="color: #0000BB">$uri</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getHost</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>Il precedente esempio visualizzerà:</p></div>
   <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">example.net</pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-uri-rfc3986-uri.withhost-seealso">
  <h3 class="title">Vedere anche:</h3>
  <ul class="simplelist">
   <li><span class="methodname"><a href="uri-rfc3986-uri.gethost.php" class="methodname" rel="rdfs-seeAlso">Uri\Rfc3986\Uri::getHost()</a> - Retrieve the normalized host component</span></li>
   <li><span class="methodname"><a href="uri-rfc3986-uri.getrawhost.php" class="methodname" rel="rdfs-seeAlso">Uri\Rfc3986\Uri::getRawHost()</a> - Retrieve the raw host component</span></li>
   <li><span class="methodname"><a href="uri-whatwg-url.withhost.php" class="methodname" rel="rdfs-seeAlso">Uri\WhatWg\Url::withHost()</a> - Modify the host component</span></li>
  </ul>
 </div>

</div><?php manual_footer($setup); ?>