<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.pgsql.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.pg-unescape-bytea.php',
    1 => 'pg_unescape_bytea',
    2 => 'Rimuove i caratteri di escape in modo binario per il tipo bytea',
  ),
  'up' => 
  array (
    0 => 'ref.pgsql.php',
    1 => 'PostgreSQL Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.pg-tty.php',
    1 => 'pg_tty',
  ),
  'next' => 
  array (
    0 => 'function.pg-untrace.php',
    1 => 'pg_untrace',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'it',
    'path' => 'reference/pgsql/functions/pg-unescape-bytea.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.pg-unescape-bytea" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">pg_unescape_bytea</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.3.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">pg_unescape_bytea</span> &mdash; <span class="dc-title">
   Rimuove i caratteri di escape in modo binario per il tipo bytea
  </span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.pg-unescape-bytea-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>pg_unescape_bytea</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">
   <span class="function"><strong>pg_unescape_bytea()</strong></span> rimuove l&#039;escape dei valori dei dati bytea di
   PostgreSQL.  Restituisce la stringa senza caratteri di escape, che potrebbe contenere dati binari.
  </p>
  <blockquote class="note"><p><strong class="note">Nota</strong>: 
   <p class="para">
    Quando si effettua la <code class="literal">SELECT</code> su un tipo bytea, PostgreSQL restituisce valori di byte ottali
    con prefisso &#039;\&#039; (ad esempio \032). Gli utenti dovrebbero riconvertire
    manualmente in formato binario.
   </p>
   <p class="para">
    Questa funzione richiede PostgreSQL 7.2 o successivo. Con PostgreSQL
    7.2.0 e 7.2.1, su i valori bytea deve essere effettuato il cast quando si abilita
    il supporto multibyte. cioè <code class="literal">INSERT INTO test_table (image)
    VALUES (&#039;$image_escaped&#039;::bytea);</code> PostgreSQL 7.2.2 o
    successivo non necessita del cast. L&#039;eccezione si verifica quando la codifica dei caratteri
    del client e del backend non corrisponde e potrebbe esserci un errore di
    flusso multibyte. L&#039;utente deve quindi eseguire il cast a bytea per evitare questo errore.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.pg-unescape-bytea-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">string</code></dt>
     <dd>
      <p class="para">
       Una <span class="type"><a href="language.types.string.php" class="type string">string</a></span> contenente i dati bytea di PostgreSQL da convertire in
       una stringa binaria PHP.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.pg-unescape-bytea-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="para">
   Una <span class="type"><a href="language.types.string.php" class="type string">string</a></span> contenente i dati senza caratteri di escape.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.pg-unescape-bytea-examples">
  <h3 class="title">Esempi</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 Esempio di <span class="function"><strong>pg_unescape_bytea()</strong></span></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: #FF8000">// Connessione al database<br />  </span><span style="color: #0000BB">$dbconn </span><span style="color: #007700">= </span><span style="color: #0000BB">pg_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">'dbname=foo'</span><span style="color: #007700">);<br />  <br />  </span><span style="color: #FF8000">// Ottiene i dati di bytea<br />  </span><span style="color: #0000BB">$res </span><span style="color: #007700">= </span><span style="color: #0000BB">pg_query</span><span style="color: #007700">(</span><span style="color: #DD0000">"SELECT data FROM gallery WHERE name='Pine trees'"</span><span style="color: #007700">);  <br />  </span><span style="color: #0000BB">$raw </span><span style="color: #007700">= </span><span style="color: #0000BB">pg_fetch_result</span><span style="color: #007700">(</span><span style="color: #0000BB">$res</span><span style="color: #007700">, </span><span style="color: #DD0000">'data'</span><span style="color: #007700">);<br />  <br />  </span><span style="color: #FF8000">// Converte in binario e invia al browser<br />  </span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Content-type: image/jpeg'</span><span style="color: #007700">);<br />  echo </span><span style="color: #0000BB">pg_unescape_bytea</span><span style="color: #007700">(</span><span style="color: #0000BB">$raw</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.pg-unescape-bytea-seealso">
  <h3 class="title">Vedere anche:</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.pg-escape-bytea.php" class="function" rel="rdfs-seeAlso">pg_escape_bytea()</a> - Aggiunge le sequenze di escape ai dati binari nel tipo bytea</span></li>
    <li><span class="function"><a href="function.pg-escape-string.php" class="function" rel="rdfs-seeAlso">pg_escape_string()</a> - Aggiunge le sequenze di escape nei tipi text/char</span></li>
   </ul>
  </p>
 </div>

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