IntlChar::forDigit() function in PHP


The IntlChar::forDigit() function displays the character representation of specified digit in the specified radix.

Syntax

IntlChar::forDigit(digit,radix )

Parameters

  • Digit − A number to convert to a character

  • Radix − The radix value. Default 10.

Return

The IntlChar::forDigit() function returns the character representation of specified digit in the specified radix.

Example

The following is an example −

<?php
   var_dump(IntlChar::forDigit(7));
   echo "<br>";
   var_dump(IntlChar::forDigit(5, 16));
   echo "<br>";
   var_dump(IntlChar::forDigit(0));
?>

Output

The following is the output −

int(55)
int(53)
int(48)

Updated on: 30-Dec-2019

13 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements