<?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 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.pg-unescape-bytea.php',
    1 => 'pg_unescape_bytea',
    2 => 'Supprime la protection d\'une cha&icirc;ne de type bytea',
  ),
  'up' => 
  array (
    0 => 'ref.pgsql.php',
    1 => 'pg_cancel_query',
  ),
  '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' => 'fr',
    '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">
   Supprime la protection d&#039;une chaîne de type bytea
  </span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.pg-unescape-bytea-description">
  <h3 class="title">Description</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> supprime la protection des
   caractères de type bytea. Elle retourne la <a href="language.types.string.php" class="link">chaîne de caractères</a> protégée, pouvant
   contenir des données binaires.
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    Lors de l&#039;utilisation d&#039;une commande <code class="literal">SELECT</code> 
    avec des données de type bytea, PostgreSQL retourne des valeurs 
    octales, préfixées avec des antislashs \ (e.g. \032). Les utilisateurs
    doivent effectuer la conversion en format binaire eux-mêmes.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.pg-unescape-bytea-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">string</code></dt>
     <dd>
      <p class="para">
       Une <a href="language.types.string.php" class="link">chaîne de caractères</a> contenant les données bytea PostgreSQL à être converties
       en <a href="language.types.string.php" class="link">chaîne de caractères</a> binaire PHP.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.pg-unescape-bytea-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Une <a href="language.types.string.php" class="link">chaîne de caractères</a> contenant les données protégées.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.pg-unescape-bytea-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Exemple avec <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">// Connexion à la base de données<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">// Récupération des données 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 galerie WHERE nom='Arbres Pin'"</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">// Convertit en binaire et envoie au navigateur<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">Voir aussi</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> - Prot&egrave;ge une cha&icirc;ne pour insertion dans un champ bytea</span></li>
    <li><span class="function"><a href="function.pg-escape-string.php" class="function" rel="rdfs-seeAlso">pg_escape_string()</a> - Prot&egrave;ge une cha&icirc;ne de caract&egrave;res pour une requ&ecirc;te SQL</span></li>
   </ul>
  </p>
 </div>

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