Statement on glibc/iconv Vulnerability

str_increment

(PHP 8 >= 8.3.0)

str_incrementIncrement an alphanumeric string

Açıklama

str_increment(string $string): string

Returns the incremented alphanumeric ASCII string.

Bağımsız Değişkenler

string

The input string.

Dönen Değerler

Returns the incremented alphanumeric ASCII string.

Hatalar/İstisnalar

A ValueError is thrown if string is empty.

A ValueError is thrown if string is not an alphanumeric ASCII string.

Örnekler

Örnek 1 Basic str_increment() example

<?php
$str
= 'ABC';
var_dump(str_increment($str));
?>

Yukarıdaki örneğin çıktısı:

string(3) "ABD"

Örnek 2 str_increment() example with a carry

<?php
$str
= 'DZ';
var_dump(str_increment($str));

$str = 'ZZ';
var_dump(str_increment($str));
?>

Yukarıdaki örneğin çıktısı:

string(2) "EA"
string(3) "AAA"

Ayrıca Bakınız

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top