<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.strings.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'es',
  ),
  'this' => 
  array (
    0 => 'function.str-decrement.php',
    1 => 'str_decrement',
    2 => 'Decrementa un string alfanum&eacute;rico',
  ),
  'up' => 
  array (
    0 => 'ref.strings.php',
    1 => 'Funciones de strings',
  ),
  'prev' => 
  array (
    0 => 'function.str-contains.php',
    1 => 'str_contains',
  ),
  'next' => 
  array (
    0 => 'function.str-ends-with.php',
    1 => 'str_ends_with',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'es',
    'path' => 'reference/strings/functions/str-decrement.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.str-decrement" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">str_decrement</h1>
  <p class="verinfo">(PHP 8 &gt;= 8.3.0)</p><p class="refpurpose"><span class="refname">str_decrement</span> &mdash; <span class="dc-title">Decrementa un string alfanumérico</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.str-decrement-description">
  <h3 class="title">Descripción</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>str_decrement</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="type"><a href="language.types.string.php" class="type string">string</a></span></div>

  <p class="para rdfs-comment">
   Devuelve el string alfanumérico <abbr title="American Standard Code for Information Interchange">ASCII</abbr> decrementado
   <code class="parameter">string</code>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.str-decrement-parameters">
  <h3 class="title">Parámetros</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">string</code></dt>
     <dd>
      <p class="para">
       El string a decrementar.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.str-decrement-returnvalues">
  <h3 class="title">Valores devueltos</h3>
  <p class="para">
   Devuelve el string alfanumérico <abbr title="American Standard Code for Information Interchange">ASCII</abbr> decrementado.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.str-decrement-errors">
  <h3 class="title">Errores/Excepciones</h3>
  <p class="para">
   Se lanza una excepción <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span> si
   <code class="parameter">string</code> está vacío.
  </p>
  <p class="para">
   Se lanza una excepción <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span> si
   <code class="parameter">string</code> no es un string alfanumérico
   <abbr title="American Standard Code for Information Interchange">ASCII</abbr>.
  </p>
  <p class="para">
   Se lanza una excepción <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span> si
   <code class="parameter">string</code> no puede ser decrementado.
   Por ejemplo, <code class="literal">&quot;A&quot;</code> o <code class="literal">&quot;0&quot;</code>.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.str-decrement-examples">
  <h3 class="title">Ejemplos</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Ejemplo #1 Ejemplo básico de la función <span class="function"><strong>str_decrement()</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 />$str </span><span style="color: #007700">= </span><span style="color: #DD0000">'ABC'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">str_decrement</span><span style="color: #007700">(</span><span style="color: #0000BB">$str</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>El ejemplo anterior mostrará:</p></div>
    <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">string(3) &quot;ABB&quot;</pre>
</div>
    </div>
   </div>
  </p>
  <p class="para">
   <div class="example" id="example-2">
    <p><strong>Ejemplo #2 Ejemplo de la función <span class="function"><strong>str_decrement()</strong></span> con una retención</strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$str </span><span style="color: #007700">= </span><span style="color: #DD0000">'ZA'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">str_decrement</span><span style="color: #007700">(</span><span style="color: #0000BB">$str</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB">$str </span><span style="color: #007700">= </span><span style="color: #DD0000">'AA'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">str_decrement</span><span style="color: #007700">(</span><span style="color: #0000BB">$str</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>El ejemplo anterior mostrará:</p></div>
    <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">string(2) &quot;YZ&quot;
string(1) &quot;Z&quot;</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.str-decrement-seealso">
  <h3 class="title">Ver también</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.str-increment.php" class="function" rel="rdfs-seeAlso">str_increment()</a> - Incrementa un string alfanum&eacute;rica</span></li>
   </ul>
  </p>
 </div>


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