<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.iconv.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'function.iconv.php',
    1 => 'iconv',
    2 => 'Convert a string from one character encoding to another',
  ),
  'up' => 
  array (
    0 => 'ref.iconv.php',
    1 => 'Функції iconv',
  ),
  'prev' => 
  array (
    0 => 'ref.iconv.php',
    1 => 'Функції iconv',
  ),
  'next' => 
  array (
    0 => 'function.iconv-get-encoding.php',
    1 => 'iconv_get_encoding',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/iconv/functions/iconv.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.iconv" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">iconv</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.5, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">iconv</span> &mdash; <span class="dc-title">Convert a string from one character encoding to another</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.iconv-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>iconv</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$from_encoding</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$to_encoding</code></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"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Converts <code class="parameter">string</code> from <code class="parameter">from_encoding</code>
   to <code class="parameter">to_encoding</code>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.iconv-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">from_encoding</code></dt>
     <dd>
      <p class="para">
       The current encoding used to interpret <code class="parameter">string</code>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">to_encoding</code></dt>
     <dd>
      <p class="para">
       The desired encoding of the result.
      </p>
      <p class="para">
       If the string <code class="literal">//TRANSLIT</code> is appended to
       <code class="parameter">to_encoding</code>, then transliteration is activated. This
       means that when a character can&#039;t be represented in the target charset,
       it may be approximated through one or several similarly looking
       characters. If the string <code class="literal">//IGNORE</code> is appended,
       characters that cannot be represented in the target charset are silently
       discarded. Otherwise, <strong><code><a href="errorfunc.constants.php#constant.e-notice">E_NOTICE</a></code></strong> is generated and the function
       will return <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>.
      </p>
      <div class="caution"><strong class="caution">Застереження</strong>
       <p class="para">
        If and how <code class="literal">//TRANSLIT</code> works exactly depends on the
        system&#039;s iconv() implementation (cf. <strong><code><a href="iconv.constants.php#constant.iconv-impl">ICONV_IMPL</a></code></strong>).
        Some implementations are known to ignore <code class="literal">//TRANSLIT</code>,
        so the conversion is likely to fail for characters which are illegal for
        the <code class="parameter">to_encoding</code>.
       </p>
      </div>
     </dd>
    
    
     <dt><code class="parameter">string</code></dt>
     <dd>
      <p class="para">
       The <span class="type"><a href="language.types.string.php" class="type string">string</a></span> to be converted.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.iconv-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   Returns the converted string, або <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> в разі помилки.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.iconv-examples">
  <h3 class="title">Приклади</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Приклад #1 <span class="function"><strong>iconv()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$text </span><span style="color: #007700">= </span><span style="color: #DD0000">"This is the Euro symbol '€'."</span><span style="color: #007700">;<br /><br />echo </span><span style="color: #DD0000">'Original : '</span><span style="color: #007700">, </span><span style="color: #0000BB">$text</span><span style="color: #007700">, </span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">'TRANSLIT : '</span><span style="color: #007700">, </span><span style="color: #0000BB">iconv</span><span style="color: #007700">(</span><span style="color: #DD0000">"UTF-8"</span><span style="color: #007700">, </span><span style="color: #DD0000">"ISO-8859-1//TRANSLIT"</span><span style="color: #007700">, </span><span style="color: #0000BB">$text</span><span style="color: #007700">), </span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">'IGNORE   : '</span><span style="color: #007700">, </span><span style="color: #0000BB">iconv</span><span style="color: #007700">(</span><span style="color: #DD0000">"UTF-8"</span><span style="color: #007700">, </span><span style="color: #DD0000">"ISO-8859-1//IGNORE"</span><span style="color: #007700">, </span><span style="color: #0000BB">$text</span><span style="color: #007700">), </span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">'Plain    : '</span><span style="color: #007700">, </span><span style="color: #0000BB">iconv</span><span style="color: #007700">(</span><span style="color: #DD0000">"UTF-8"</span><span style="color: #007700">, </span><span style="color: #DD0000">"ISO-8859-1"</span><span style="color: #007700">, </span><span style="color: #0000BB">$text</span><span style="color: #007700">), </span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>Поданий вище приклад виведе щось
схоже на:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">Original : This is the Euro symbol &#039;€&#039;.
TRANSLIT : This is the Euro symbol &#039;EUR&#039;.
IGNORE   : This is the Euro symbol &#039;&#039;.
Plain    :
Notice: iconv(): Detected an illegal character in input string in .\iconv-example.php on line 7</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.iconv-notes">
  <h3 class="title">Примітки</h3>
  <blockquote class="note"><p><strong class="note">Зауваження</strong>: 
   <p class="para">
    The character encodings and options available depend on the installed implementation
    of iconv. If the argument to <code class="parameter">from_encoding</code>
    or <code class="parameter">to_encoding</code> is not supported on the current system, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>
    will be returned.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.iconv-seealso">
  <h3 class="title">Прогляньте також</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.mb-convert-encoding.php" class="function" rel="rdfs-seeAlso">mb_convert_encoding()</a> - Convert a string from one character encoding to another</span></li>
    <li><span class="methodname"><a href="uconverter.transcode.php" class="methodname" rel="rdfs-seeAlso">UConverter::transcode()</a> - Convert a string from one character encoding to another</span></li>
   </ul>
  </p>
 </div>


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