str_decrement()

str_decrement() — Decrement an alphanumeric string.

Built-in function of PHP 8.5. The manual lists it as available in PHP 8 >= 8.3.0. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.

Signature

str_decrement(string $string): string

Parameters

ParameterTypeWhat it takes
$stringstringThe input string.

Return value

Returns the decremented alphanumeric ASCII string.

Example

A runnable snippet:

$str = 'ABC'; var_dump(str_decrement($str));

Output:

string(3) "ABB"

See also

str_increment()

All PHP 8.5 built-in functions

Reference card built from the PHP manual page str_decrement() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.