<?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.base64-encode.php',
    1 => 'base64_encode',
    2 => 'Encodes data with MIME base64',
  ),
  'up' => 
  array (
    0 => 'ref.url.php',
    1 => 'URL Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.base64-decode.php',
    1 => 'base64_decode',
  ),
  'next' => 
  array (
    0 => 'function.get-headers.php',
    1 => 'get_headers',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/url/functions/base64-encode.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.base64-encode" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">base64_encode</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">base64_encode</span> &mdash; <span class="dc-title">Encodes data with MIME base64</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.base64-encode-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>base64_encode</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 <code class="parameter">string</code> with base64.
  </p>
  <p class="para">
   This encoding is designed to make binary data survive transport through
   transport layers that are not 8-bit clean, such as mail bodies.
  </p>
  <p class="para">
   Base64-encoded data takes about 33% more space than the original
   data.
  </p>
 </div>


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


 <div class="refsect1 returnvalues" id="refsect1-function.base64-encode-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="para">
   The encoded data, as a string.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.base64-encode-examples">
  <h3 class="title">Esempi</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 <span class="function"><strong>base64_encode()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$str </span><span style="color: #007700">= </span><span style="color: #DD0000">'This is an encoded string'</span><span style="color: #007700">;<br />echo </span><span style="color: #0000BB">base64_encode</span><span style="color: #007700">(</span><span style="color: #0000BB">$str</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">VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw==</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.base64-encode-seealso">
  <h3 class="title">Vedere anche:</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.base64-decode.php" class="function" rel="rdfs-seeAlso">base64_decode()</a> - Decodes data encoded with MIME base64</span></li>
    <li><span class="function"><a href="function.chunk-split.php" class="function" rel="rdfs-seeAlso">chunk_split()</a> - Divide una stringa in segmento pi&ugrave; piccoli</span></li>
    <li><span class="function"><a href="function.convert-uuencode.php" class="function" rel="rdfs-seeAlso">convert_uuencode()</a> - Codifica uuencode  di una stringa</span></li>
    <li><a href="https://datatracker.ietf.org/doc/html/rfc2045" class="link external">&raquo;&nbsp;RFC 2045</a> section 6.8</li>
   </ul>
  </p>
 </div>


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