No cache version.

Caching disabled. Default setting for this page:enabled (code LNG204)
If the display is too slow, you can disable the user mode to view the cached version.

Rechercher une fonction PHP

IntlChar::forDigit

(PHP 7)

IntlChar::forDigitGet character representation for a given digit and radix

Description

public static IntlChar::forDigit ( int $digit [, int $radix = 10 ] ) : int

Determines the character representation for a specific digit in the specified radix.

If the value of radix is not a valid radix, or the value of digit is not a valid digit in the specified radix, the null character (U+0000) is returned.

The radix argument is valid if it is greater than or equal to 2 and less than or equal to 36. The digit argument is valid if 0 <= digit < radix.

If the digit is less than 10, then '0' + digit is returned. Otherwise, the value 'a' + digit - 10 is returned.

PHP: IntlChar::forDigit - Manual Home of Manuel PHP  Contents Haut

Parameters

digit

The number to convert to a character.

radix

The radix (defaults to 10).

PHP: IntlChar::forDigit - Manual Home of Manuel PHP  Contents Haut

Return Values

The character representation (as a string) of the specified digit in the specified radix.

PHP: IntlChar::forDigit - Manual Home of Manuel PHP  Contents Haut

Examples

Example #1 Testing different code points

<?php
var_dump
(IntlChar::forDigit(0));
var_dump(IntlChar::forDigit(3));
var_dump(IntlChar::forDigit(310));
var_dump(IntlChar::forDigit(10));
var_dump(IntlChar::forDigit(1016));
?>

The above example will output:

int(48)
int(51)
int(51)
int(0)
int(97)

PHP: IntlChar::forDigit - Manual Home of Manuel PHP  Contents Haut

See Also

Find a PHP function
Error Infobrol

Can not display this page of the Infobrol website

Type of error (18-01)

Unknown format specifier "&"

Please try again in a few minutes…

Return to the home page




Steph