<?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 => 'ja',
  ),
  'this' => 
  array (
    0 => 'uri-rfc3986-uri.withfragment.php',
    1 => 'Uri\\Rfc3986\\Uri::withFragment',
    2 => 'Modify the fragment component',
  ),
  'up' => 
  array (
    0 => 'class.uri-rfc3986-uri.php',
    1 => 'Uri\\Rfc3986\\Uri',
  ),
  'prev' => 
  array (
    0 => 'uri-rfc3986-uri.unserialize.php',
    1 => 'Uri\\Rfc3986\\Uri::__unserialize',
  ),
  'next' => 
  array (
    0 => 'uri-rfc3986-uri.withhost.php',
    1 => 'Uri\\Rfc3986\\Uri::withHost',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/uri/uri/rfc3986/uri/withfragment.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

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

 </div>

 <div class="refsect1 description" id="refsect1-uri-rfc3986-uri.withfragment-description">
  <h3 class="title">説明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Uri\Rfc3986\Uri::withFragment</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">$fragment</code></span>): <span class="type">static</span></div>

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


 <div class="refsect1 parameters" id="refsect1-uri-rfc3986-uri.withfragment-parameters">
  <h3 class="title">パラメータ</h3>
  <dl>
   
    <dt><code class="parameter">fragment</code></dt>
    <dd>
     <span class="simpara">
      New fragment component.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-uri-rfc3986-uri.withfragment-returnvalues">
  <h3 class="title">戻り値</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.withfragment-errors">
  <h3 class="title">エラー / 例外</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.withfragment-examples">
  <h3 class="title">例</h3>
  <div class="example" id="uri-rfc3986-uri.withfragment.example.basic">
   <p><strong>例1 <span class="methodname"><strong>Uri\Rfc3986\Uri::withFragment()</strong></span> basic example</strong></p>
   <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000">$uri = new \Uri\Rfc3986\Uri("https://example.com/#foo");<br />$uri = $uri-&gt;withFragment("bar");<br /><br />echo $uri-&gt;getFragment();<br />?&gt;</span></code></div>
   </div>

   <div class="example-contents"><p>上の例の出力は以下となります。</p></div>
   <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">bar</pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-uri-rfc3986-uri.withfragment-seealso">
  <h3 class="title">参考</h3>
  <ul class="simplelist">
   <li><span class="methodname"><a href="uri-rfc3986-uri.getfragment.php" class="methodname" rel="rdfs-seeAlso">Uri\Rfc3986\Uri::getFragment()</a> - Retrieve the normalized fragment component</span></li>
   <li><span class="methodname"><a href="uri-rfc3986-uri.getrawfragment.php" class="methodname" rel="rdfs-seeAlso">Uri\Rfc3986\Uri::getRawFragment()</a> - Retrieve the raw fragment component</span></li>
   <li><span class="methodname"><a href="uri-whatwg-url.withfragment.php" class="methodname" rel="rdfs-seeAlso">Uri\WhatWg\Url::withFragment()</a> - Modify the fragment component</span></li>
  </ul>
 </div>

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