<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.strings.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.implode.php',
    1 => 'implode',
    2 => 'Unisce gli elementi di un array in una stringa',
  ),
  'up' => 
  array (
    0 => 'ref.strings.php',
    1 => 'String Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.htmlspecialchars-decode.php',
    1 => 'htmlspecialchars_decode',
  ),
  'next' => 
  array (
    0 => 'function.join.php',
    1 => 'join',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'it',
    'path' => 'reference/strings/functions/implode.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.implode" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">implode</h1>
    <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">implode</span> &mdash; <span class="dc-title">Unisce gli elementi di un array in una stringa</span></p>

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

    <p class="para rdfs-comment">
     Restituisce una stringa contenente tutti gli elementi di un
     array nel medesimo ordine, inserendo il parametro glue tra un
     elemento e l&#039;altro.
     <div class="example" id="example-1">
      <p><strong>Example #1 Esempio di uso di <span class="function"><strong>implode()</strong></span></strong></p>
      <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />$array </span><span style="color: #007700">= array(</span><span style="color: #DD0000">'lastname'</span><span style="color: #007700">, </span><span style="color: #DD0000">'email'</span><span style="color: #007700">, </span><span style="color: #DD0000">'phone'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$comma_separated </span><span style="color: #007700">= </span><span style="color: #0000BB">implode</span><span style="color: #007700">(</span><span style="color: #DD0000">","</span><span style="color: #007700">, </span><span style="color: #0000BB">$array</span><span style="color: #007700">);<br /><br />echo </span><span style="color: #0000BB">$comma_separated</span><span style="color: #007700">; </span><span style="color: #FF8000">// lastname,email,phone<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
      </div>

     </div>
    </p>
    <blockquote class="note"><p><strong class="note">Nota</strong>: 
     <p class="para">
      La funzione <span class="function"><strong>implode()</strong></span>, per ragioni storiche, può accettare
      i propri parametri in entrambi gli ordini. Tuttavia per mantenere la consistenza con
      <span class="function"><a href="function.explode.php" class="function">explode()</a></span>, ed avere meno confusione, 
      utilizzare i parametri nell&#039;ordine documentato.
     </p>
    </p></blockquote>
    <blockquote class="note"><p><strong class="note">Nota</strong>: 
     <p class="para">
      Dal PHP 4.3.0, il parametro glue di <span class="function"><strong>implode()</strong></span> è opzionale
      e come default utilizza una stringa vuota (&#039;&#039;). Questo non è l&#039;utilizzo
      preferenziale di <span class="function"><strong>implode()</strong></span>. Si suggerisce di utilizzare sempre il
      secondo parametro per compatibilità con le vecchie versioni.
     </p>
    </p></blockquote>

    <blockquote class="note"><p><strong class="note">Nota</strong>: <span class="simpara">Questa funzione è
 binary-safe (gestisce correttamente i file binari)</span></p></blockquote>

    <p class="simpara">
     Vedere anche <span class="function"><a href="function.explode.php" class="function">explode()</a></span> e <span class="function"><strong>split()</strong></span>.
    </p>
   </div>

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