IntlChar::forDigit
(PHP 7)
IntlChar::forDigit — Get character representation for a given digit and radix
Описание
$digit
[, int $radix
= 10
] )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.
Список параметров
-
digit
-
The number to convert to a character.
-
radix
-
The radix (defaults to 10).
Возвращаемые значения
The character representation (as a string) of the specified digit in the specified radix.
Примеры
Пример #1 Testing different code points
<?php
var_dump(IntlChar::forDigit(0));
var_dump(IntlChar::forDigit(3));
var_dump(IntlChar::forDigit(3, 10));
var_dump(IntlChar::forDigit(10));
var_dump(IntlChar::forDigit(10, 16));
?>
Результат выполнения данного примера:
int(48) int(51) int(51) int(0) int(97)
Смотрите также
- IntlChar::digit() - Get the decimal digit value of a code point for a given radix
- IntlChar::charDigitValue() - Get the decimal digit value of a decimal digit character
- IntlChar::isdigit() - Check if code point is a digit character
IntlChar::PROPERTY_NUMERIC_TYPE
- PHP Руководство
- Функции по категориям
- Индекс функций
- Справочник функций
- Поддержка языков и кодировок
- Internationalization Functions
- IntlChar::charAge
- IntlChar::charDigitValue
- IntlChar::charDirection
- IntlChar::charFromName
- IntlChar::charMirror
- IntlChar::charName
- IntlChar::charType
- IntlChar::chr
- IntlChar::digit
- IntlChar::enumCharNames
- IntlChar::enumCharTypes
- IntlChar::foldCase
- IntlChar::forDigit
- IntlChar::getBidiPairedBracket
- IntlChar::getBlockCode
- IntlChar::getCombiningClass
- IntlChar::getFC_NFKC_Closure
- IntlChar::getIntPropertyMaxValue
- IntlChar::getIntPropertyMinValue
- IntlChar::getIntPropertyValue
- IntlChar::getNumericValue
- IntlChar::getPropertyEnum
- IntlChar::getPropertyName
- IntlChar::getPropertyValueEnum
- IntlChar::getPropertyValueName
- IntlChar::getUnicodeVersion
- IntlChar::hasBinaryProperty
- IntlChar::isalnum
- IntlChar::isalpha
- IntlChar::isbase
- IntlChar::isblank
- IntlChar::iscntrl
- IntlChar::isdefined
- IntlChar::isdigit
- IntlChar::isgraph
- IntlChar::isIDIgnorable
- IntlChar::isIDPart
- IntlChar::isIDStart
- IntlChar::isISOControl
- IntlChar::isJavaIDPart
- IntlChar::isJavaIDStart
- IntlChar::isJavaSpaceChar
- IntlChar::islower
- IntlChar::isMirrored
- IntlChar::isprint
- IntlChar::ispunct
- IntlChar::isspace
- IntlChar::istitle
- IntlChar::isUAlphabetic
- IntlChar::isULowercase
- IntlChar::isupper
- IntlChar::isUUppercase
- IntlChar::isUWhiteSpace
- IntlChar::isWhitespace
- IntlChar::isxdigit
- IntlChar::ord
- IntlChar::tolower
- IntlChar::totitle
- IntlChar::toupper
Коментарии
404 Not Found