<?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 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.mb-strimwidth.php',
    1 => 'mb_strimwidth',
    2 => 'Tronque une cha&icirc;ne',
  ),
  'up' => 
  array (
    0 => 'ref.mbstring.php',
    1 => 'Fonctions sur les cha&icirc;nes de caract&egrave;res multioctets',
  ),
  'prev' => 
  array (
    0 => 'function.mb-strcut.php',
    1 => 'mb_strcut',
  ),
  'next' => 
  array (
    0 => 'function.mb-stripos.php',
    1 => 'mb_stripos',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/mbstring/functions/mb-strimwidth.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.mb-strimwidth" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mb_strimwidth</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.6, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">mb_strimwidth</span> &mdash; <span class="dc-title">Tronque une chaîne</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.mb-strimwidth-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>mb_strimwidth</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"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$width</code></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">$trim_marker</code><span class="initializer"> = &quot;&quot;</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">
   Tronque la chaîne <code class="parameter">string</code> à la longueur
   <code class="parameter">width</code> spécifiée,
   où les caractères à demi-chasse comptent en tant que <code class="literal">1</code>, et
   les caractères à pleine chasse comptent en tant que <code class="literal">2</code>.
   Voir <a href="http://www.unicode.org/reports/tr11/" class="link external">&raquo;&nbsp;http://www.unicode.org/reports/tr11/</a>
   pour plus de détails concernant les chasses des caractères asiatiques de l&#039;Est.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mb-strimwidth-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">string</code></dt>
     <dd>
      <p class="para">
       La chaîne à tronquer.
      </p>
     </dd>
    
    
     <dt><code class="parameter">start</code></dt>
     <dd>
      <p class="para">
       <code class="parameter">start</code> est la position de départ, en nombre
       de caractères depuis le début de la chaîne (premier caractère est 0),
       ou si la position est négative, nombre de caractères à partir de la fin de la <a href="language.types.string.php" class="link">chaîne de caractères</a>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">width</code></dt>
     <dd>
      <p class="para">
       La largeur de la troncation souhaitée.
       Si une largeur négative est spécifiée, il faut compter à partir de la fin de la chaîne.
       <blockquote class="note"><p><strong class="note">Note</strong>: 
        <p class="para">
         Fournir une largeur négative est obsolète à partir de PHP 8.3.0.
        </p>
       </p></blockquote>
      </p>
     </dd>
    
    
     <dt><code class="parameter">trim_marker</code></dt>
     <dd>
      <p class="para">
       <code class="parameter">trim_marker</code> est la chaîne ajoutée à la fin de la chaîne tronquée.
      </p>
     </dd>
    
    
     <dt><code class="parameter">encoding</code></dt>
     <dd>
      <p class="para">Le paramètre <code class="parameter">encoding</code>
est l&#039;encodage des caractères. S&#039;il est omis ou <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>, l&#039;encodage de caractères interne
sera utilisé.</p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.mb-strimwidth-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   La chaîne tronquée. Si <code class="parameter">trim_marker</code> est défini,
   <code class="parameter">trim_marker</code> remplace les derniers caractères pour correspondre à la taille <code class="parameter">width</code>.
  </p>
 </div>

 
 <div class="refsect1 changelog" id="refsect1-function.mb-strimwidth-changelog">
  <h3 class="title">Historique</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.3.0</td>
      <td>
       Fournir une <code class="parameter">width</code> négative à
       <span class="function"><strong>mb_strimwidth()</strong></span> est désormais obsolète.
      </td>
     </tr>

     <tr>
 <td>8.0.0</td>
 <td>
  <code class="parameter">encoding</code> est désormais nullable.
 </td>
</tr>

     <tr>
      <td>7.1.0</td>
      <td>
       Support pour <code class="parameter">start</code>s et <code class="parameter">width</code>s négatifs a été ajouté.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.mb-strimwidth-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Exemple avec <span class="function"><strong>mb_strimwidth()</strong></span></strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">mb_strimwidth</span><span style="color: #007700">(</span><span style="color: #DD0000">"Hello World"</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">10</span><span style="color: #007700">, </span><span style="color: #DD0000">"..."</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">// Affiche : "Hello W..."<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.mb-strimwidth-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.mb-strwidth.php" class="function" rel="rdfs-seeAlso">mb_strwidth()</a> - Retourne la taille d'une cha&icirc;ne</span></li>
    <li><span class="function"><a href="function.mb-internal-encoding.php" class="function" rel="rdfs-seeAlso">mb_internal_encoding()</a> - Lit/modifie l'encodage interne</span></li>
   </ul>
  </p>
 </div>


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