<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.url.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.rawurlencode.php',
    1 => 'rawurlencode',
    2 => 'URL-encode according to RFC 3986',
  ),
  'up' => 
  array (
    0 => 'ref.url.php',
    1 => 'URL Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.rawurldecode.php',
    1 => 'rawurldecode',
  ),
  'next' => 
  array (
    0 => 'function.urldecode.php',
    1 => 'urldecode',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/url/functions/rawurlencode.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.rawurlencode" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">rawurlencode</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">rawurlencode</span> &mdash; <span class="dc-title">URL-encode according to RFC 3986</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.rawurlencode-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>rawurlencode</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$string</code></span>): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>

  <p class="para rdfs-comment">
   Encodes the given string according to <a href="https://datatracker.ietf.org/doc/html/rfc3986" class="link external">&raquo;&nbsp;RFC 3986</a>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.rawurlencode-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">string</code></dt>
     <dd>
      <p class="para">
       The URL to be encoded.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.rawurlencode-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="para">
   Returns a string in which all non-alphanumeric characters except
   <code class="literal">-_.~</code> have been replaced with a percent
   (<code class="literal">%</code>) sign followed by two hex digits.  This is the
   encoding described in <a href="https://datatracker.ietf.org/doc/html/rfc3986" class="link external">&raquo;&nbsp;RFC 3986</a> for
   protecting literal characters from being interpreted as special URL
   delimiters, and for protecting URLs from being mangled by transmission
   media with character conversions (like some email systems).
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.rawurlencode-examples">
  <h3 class="title">Esempi</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 including a password in an FTP URL</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">'&lt;a href="ftp://user:'</span><span style="color: #007700">, </span><span style="color: #0000BB">rawurlencode</span><span style="color: #007700">(</span><span style="color: #DD0000">'foo @+%/'</span><span style="color: #007700">),<br />     </span><span style="color: #DD0000">'@ftp.example.com/x.txt"&gt;'</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="examplescode"><pre class="examplescode">&lt;a href=&quot;ftp://user:foo%20%40%2B%25%2F@ftp.example.com/x.txt&quot;&gt;</pre>
</div>
    </div>
   </div>
  </p>
  <p class="para">
   Or, if you pass information in a PATH_INFO component of the URL:
  </p>
  <p class="para">
   <div class="example" id="example-2">
    <p><strong>Example #2 <span class="function"><strong>rawurlencode()</strong></span> example 2</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">'&lt;a href="http://example.com/department_list_script/'</span><span style="color: #007700">,<br />    </span><span style="color: #0000BB">rawurlencode</span><span style="color: #007700">(</span><span style="color: #DD0000">'sales and marketing/Miami'</span><span style="color: #007700">), </span><span style="color: #DD0000">'"&gt;'</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="examplescode"><pre class="examplescode">&lt;a href=&quot;http://example.com/department_list_script/sales%20and%20marketing%2FMiami&quot;&gt;</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.rawurlencode-seealso">
  <h3 class="title">Vedere anche:</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.rawurldecode.php" class="function" rel="rdfs-seeAlso">rawurldecode()</a> - Decode URL-encoded strings</span></li>
    <li><span class="function"><a href="function.urldecode.php" class="function" rel="rdfs-seeAlso">urldecode()</a> - Decodes URL-encoded string</span></li>
    <li><span class="function"><a href="function.urlencode.php" class="function" rel="rdfs-seeAlso">urlencode()</a> - URL-encodes string</span></li>
    <li><a href="https://datatracker.ietf.org/doc/html/rfc3986" class="link external">&raquo;&nbsp;RFC 3986</a></li>
   </ul>
  </p>
 </div>


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