<?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 => 'ru',
  ),
  'this' => 
  array (
    0 => 'function.iconv-strlen.php',
    1 => 'iconv_strlen',
    2 => 'Возвращает количество символов в строке',
  ),
  'up' => 
  array (
    0 => 'ref.iconv.php',
    1 => 'Функции iconv',
  ),
  'prev' => 
  array (
    0 => 'function.iconv-set-encoding.php',
    1 => 'iconv_set_encoding',
  ),
  'next' => 
  array (
    0 => 'function.iconv-strpos.php',
    1 => 'iconv_strpos',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ru',
    'path' => 'reference/iconv/functions/iconv-strlen.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.iconv-strlen" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">iconv_strlen</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">iconv_strlen</span> &mdash; <span class="dc-title">Возвращает количество символов в строке</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.iconv-strlen-description">
  <h3 class="title">Описание</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>iconv_strlen</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="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$encoding</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   В отличие от функции <span class="function"><a href="function.strlen.php" class="function">strlen()</a></span>,
   функция <span class="function"><strong>iconv_strlen()</strong></span> учитывает кодировку строки.
   Длина строки <code class="parameter">string</code> иногда не соответствует количеству байтов в ней,
   поскольку в кодировках символы кодируются переменным количеством байтов,
   например, в Юникоде символы кодируются и двумя, и четырьмя байтами.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.iconv-strlen-parameters">
  <h3 class="title">Список параметров</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">string</code></dt>
     <dd>
      <p class="para">
       Строка.
      </p>
     </dd>
    
    
     <dt><code class="parameter">encoding</code></dt>
     <dd>
      <p class="para">
       Функция предполагает, что кодировка строки
       <code class="parameter">string</code> эквивалентна значению директивы
       <a href="iconv.configuration.php" class="link">iconv.internal_encoding</a>,
       если параметр <code class="parameter">encoding</code> опустили.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.iconv-strlen-returnvalues">
  <h3 class="title">Возвращаемые значения</h3>
  <p class="para">
   Функция возвращает количество символов в аргументе <code class="parameter">string</code> в виде целого числа
   или <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>, если при кодировании возникла ошибка.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.iconv-strlen-changelog">
  <h3 class="title">Список изменений</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Версия</th>
      <th>Описание</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       Параметр <code class="parameter">encoding</code> теперь принимает значение <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.iconv-strlen-seealso">
  <h3 class="title">Смотрите также</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.grapheme-strlen.php" class="function" rel="rdfs-seeAlso">grapheme_strlen()</a> - Получает длину строки в единицах графемы</span></li>
    <li><span class="function"><a href="function.mb-strlen.php" class="function" rel="rdfs-seeAlso">mb_strlen()</a> - Получает длину строки</span></li>
    <li><span class="function"><a href="function.strlen.php" class="function" rel="rdfs-seeAlso">strlen()</a> - Получает длину строки</span></li>
   </ul>
  </p>
 </div>


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