<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.mbstring.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ru',
  ),
  'this' => 
  array (
    0 => 'function.mb-substr.php',
    1 => 'mb_substr',
    2 => 'Возвращает часть строки',
  ),
  'up' => 
  array (
    0 => 'ref.mbstring.php',
    1 => 'Функции для работы с многобайтовыми строками',
  ),
  'prev' => 
  array (
    0 => 'function.mb-substitute-character.php',
    1 => 'mb_substitute_character',
  ),
  'next' => 
  array (
    0 => 'function.mb-substr-count.php',
    1 => 'mb_substr_count',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ru',
    'path' => 'reference/mbstring/functions/mb-substr.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.mb-substr" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mb_substr</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.6, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">mb_substr</span> &mdash; <span class="dc-title">Возвращает часть строки</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.mb-substr-description">
  <h3 class="title">Описание</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>mb_substr</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$string</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$start</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<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.integer.php" class="type int">int</a></span></span> <code class="parameter">$length</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<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><br>): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>

  <p class="para rdfs-comment">
   Выполняет многобайтовую безопасную операцию <span class="function"><a href="function.substr.php" class="function">substr()</a></span>,
   основываясь на количестве символов. Позиция отсчитывается от начала
   строки (<span class="type"><a href="language.types.string.php" class="type string">string</a></span>) <code class="parameter">string</code>. Позиция первого символа — 0,
   второго — 1 и т. д.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mb-substr-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">start</code></dt>
     <dd>
      <p class="para">
       Если значение параметра <code class="parameter">start</code> неотрицательное, возвращённая строка
       начнётся с позиции <code class="parameter">start</code> от начала строки
       <code class="parameter">string</code>, считая с нуля.
       Например, в строке «<code class="literal">abcdef</code>», символ в позиции <code class="literal">0</code> — это
       «<code class="literal">a</code>», символ в позиции <code class="literal">2</code> — «<code class="literal">c</code>» и т. д.
      </p>
      <p class="para">
       Если значение параметра <code class="parameter">start</code> отрицательное, возвращаемая строка начнётся
       с <code class="parameter">start</code>-го символа с конца
       строки <code class="parameter">string</code>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">length</code></dt>
     <dd>
      <p class="para">
       Максимальное количество символов подстроки, возвращаемых из строки <code class="parameter">string</code>.
       Если не указан или равен <code class="literal">NULL</code> — извлекаются
       все символы до конца строки.
      </p>
     </dd>
    
    
     <dt><code class="parameter">encoding</code></dt>
     <dd>
      
<p class="para">
 Параметр <code class="parameter">encoding</code> указывает кодировку символов.
 При пропуске параметра или передаче значения <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>
 функция интерпретирует символы в предустановленной кодировке модуля.
</p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.mb-substr-returnvalues">
  <h3 class="title">Возвращаемые значения</h3>
  <p class="para">
   Возвращает часть строки <code class="parameter">string</code>,
   заданную параметрами <code class="parameter">start</code> и <code class="parameter">length</code>.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.mb-substr-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.mb-substr-seealso">
  <h3 class="title">Смотрите также</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.mb-strcut.php" class="function" rel="rdfs-seeAlso">mb_strcut()</a> - Получает часть строки</span></li>
    <li><span class="function"><a href="function.mb-internal-encoding.php" class="function" rel="rdfs-seeAlso">mb_internal_encoding()</a> - Устанавливает или получает внутреннюю кодировку символов файла скрипта</span></li>
   </ul>
  </p>
 </div>


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