<?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-substr.php',
    1 => 'iconv_substr',
    2 => 'Cut out part of a string',
  ),
  'up' => 
  array (
    0 => 'ref.iconv.php',
    1 => 'Функції iconv',
  ),
  'prev' => 
  array (
    0 => 'function.iconv-strrpos.php',
    1 => 'iconv_strrpos',
  ),
  'next' => 
  array (
    0 => 'function.ob-iconv-handler.php',
    1 => 'ob_iconv_handler',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/iconv/functions/iconv-substr.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.iconv-substr" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">iconv_substr</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">iconv_substr</span> &mdash; <span class="dc-title">Cut out part of a string</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.iconv-substr-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>iconv_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">$offset</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"><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">
   Cuts a portion of <code class="parameter">string</code> specified by the 
   <code class="parameter">offset</code> and <code class="parameter">length</code> parameters.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.iconv-substr-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">string</code></dt>
     <dd>
      <p class="para">
       The original string.
      </p>
     </dd>
    
    
     <dt><code class="parameter">offset</code></dt>
     <dd>
      <p class="para">
       If <code class="parameter">offset</code> is non-negative,
       <span class="function"><strong>iconv_substr()</strong></span> cuts the portion out of
       <code class="parameter">string</code> beginning at <code class="parameter">offset</code>&#039;th
       character, counting from zero.
      </p>
      <p class="para">
       If <code class="parameter">offset</code> is negative,
       <span class="function"><strong>iconv_substr()</strong></span> cuts out the portion beginning
       at the position, <code class="parameter">offset</code> characters
       away from the end of <code class="parameter">string</code>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">length</code></dt>
     <dd>
      <p class="para">
       If <code class="parameter">length</code> is given and is positive, the return
       value will contain at most <code class="parameter">length</code> characters
       of the portion that begins at <code class="parameter">offset</code>
       (depending on the length of <code class="parameter">string</code>).
      </p>
      <p class="para">
       If negative <code class="parameter">length</code> is passed,
       <span class="function"><strong>iconv_substr()</strong></span> cuts the portion out of
       <code class="parameter">string</code> from the <code class="parameter">offset</code>&#039;th
       character up to the character that is
       <code class="parameter">length</code> characters away from the end of the string.
       In case <code class="parameter">offset</code> is also negative, the start position
       is calculated beforehand according to the rule explained above.
      </p>
     </dd>
    
    
     <dt><code class="parameter">encoding</code></dt>
     <dd>
      <p class="para">
       If <code class="parameter">encoding</code> parameter is omitted or <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>,
       <code class="parameter">string</code> are assumed to be encoded in
       <a href="iconv.configuration.php" class="link">iconv.internal_encoding</a>.
      </p>
      <p class="para">
       Note that <code class="parameter">offset</code> and <code class="parameter">length</code>
       parameters are always deemed to represent offsets that are
       calculated on the basis of the character set determined by
       <code class="parameter">encoding</code>, whilst the counterpart
       <span class="function"><a href="function.substr.php" class="function">substr()</a></span> always takes these for byte offsets.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.iconv-substr-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   Returns the portion of <code class="parameter">string</code> specified by the
   <code class="parameter">offset</code> and <code class="parameter">length</code> parameters.
  </p>
  <p class="para">
   If <code class="parameter">string</code> is shorter than <code class="parameter">offset</code>
   characters long, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> will be returned.
   If <code class="parameter">string</code> is exactly <code class="parameter">offset</code>
   characters long, an empty string will be returned.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.iconv-substr-changelog">
  <h3 class="title">Журнал змін</h3>
  <p class="para">
   <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">length</code> and <code class="parameter">encoding</code> are nullable now.
      </td>
     </tr>

      <tr>
       <td>7.0.11</td>
       <td>
        If <code class="parameter">string</code> is equal to
        <code class="parameter">offset</code> characters long, an empty string will be
        returned. Prior to this version, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> was returned in this case.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.iconv-substr-seealso">
  <h3 class="title">Прогляньте також</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.substr.php" class="function" rel="rdfs-seeAlso">substr()</a> - Return part of a string</span></li>
    <li><span class="function"><a href="function.mb-substr.php" class="function" rel="rdfs-seeAlso">mb_substr()</a> - Get part of string</span></li>
    <li><span class="function"><a href="function.mb-strcut.php" class="function" rel="rdfs-seeAlso">mb_strcut()</a> - Get part of string</span></li>
   </ul>
  </p>
 </div>


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