<?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 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.mb-strcut.php',
    1 => 'mb_strcut',
    2 => 'Get part of string',
  ),
  'up' => 
  array (
    0 => 'ref.mbstring.php',
    1 => 'Multibyte String Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.mb-str-split.php',
    1 => 'mb_str_split',
  ),
  'next' => 
  array (
    0 => 'function.mb-strimwidth.php',
    1 => 'mb_strimwidth',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/mbstring/functions/mb-strcut.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.mb-strcut" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mb_strcut</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.6, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">mb_strcut</span> &mdash; <span class="dc-title">Get part of string</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.mb-strcut-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>mb_strcut</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"><strong>mb_strcut()</strong></span> extracts a substring from a string similarly to
   <span class="function"><a href="function.mb-substr.php" class="function">mb_substr()</a></span>, but operates on bytes instead of characters. If the
   cut position happens to be between two bytes of a multi-byte character, the cut is
   performed starting from the first byte of that character. This is also the difference
   to the <span class="function"><a href="function.substr.php" class="function">substr()</a></span> function, which would simply cut the string between
   the bytes and thus result in a malformed byte sequence.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mb-strcut-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <p class="para">
   <dl>
    
     <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> being cut.
      </p>
     </dd>
    
    
     <dt><code class="parameter">start</code></dt>
     <dd>
      <p class="para">
       If <code class="parameter">start</code> is non-negative, the returned string
       will start at the <code class="parameter">start</code>&#039;th <em>byte</em> position in
       <code class="parameter">string</code>, counting from zero. For instance,
       in the string &#039;<code class="literal">abcdef</code>&#039;, the byte at
       position <code class="literal">0</code> is &#039;<code class="literal">a</code>&#039;, the
       byte at position <code class="literal">2</code> is
       &#039;<code class="literal">c</code>&#039;, and so forth.
      </p>
      <p class="para">
       If <code class="parameter">start</code> is negative, the returned string
       will start at the <code class="parameter">start</code>&#039;th byte
       counting back from the end of <code class="parameter">string</code>. However, if the
       magnitude of a negative <code class="parameter">start</code> is greater than the
       length of the string, the returned portion will start from the beginning of
       <code class="parameter">string</code>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">length</code></dt>
     <dd>
      <p class="para">
       Length in <em>bytes</em>. If omitted or <code class="literal">NULL</code>
       is passed, extract all bytes to the end of the string.
      </p>
      <p class="para">
       If <code class="parameter">length</code> is negative, the returned string will
       end at the <code class="parameter">length</code>&#039;th byte counting back from the
       end of <code class="parameter">string</code>. However, if the magnitude of a negative
       <code class="parameter">length</code> is greater than the number of characters
       after the <code class="parameter">start</code> position, an empty string will
       be returned.
      </p>
     </dd>
    
    
     <dt><code class="parameter">encoding</code></dt>
     <dd>
      <p class="para">Il parametro <code class="parameter">encoding</code> 
è la codifica dei caratteri. Se è omesso, verrà utilizzata la 
codifica interna.</p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.mb-strcut-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="para">
   <span class="function"><strong>mb_strcut()</strong></span> returns the portion of
   <code class="parameter">string</code> specified by the
   <code class="parameter">start</code> and
   <code class="parameter">length</code> parameters.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.mb-strcut-changelog">
  <h3 class="title">Log delle modifiche</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Versione</th>
      <th>Descrizione</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.0.0</td>
 <td>
  <code class="parameter">encoding</code> is nullable now.
 </td>
</tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.mb-strcut-seealso">
  <h3 class="title">Vedere anche:</h3>
  <p class="para">
   <ul class="simplelist">
    <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-internal-encoding.php" class="function" rel="rdfs-seeAlso">mb_internal_encoding()</a> - Set/Get internal character encoding</span></li>
   </ul>
  </p>
 </div>


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