IntlChar::chr() function in PHP



The IntlChar::chr() function is used to check whether the entered character is Unicode value or not

Syntax

IntlChar::chr( val )

Parameters

  • val − A character value encoded as a UTF-8 string.

Return

The IntlChar::chr() function returns TRUE if the val is a Unicode character.

Example

The following is an example −

<?php
   var_dump(IntlChar::chr("A"));
   echo "<br>";
   var_dump(IntlChar::chr("bh"));
   echo "<br>";
   var_dump(IntlChar::chr("^"));
?>

Output

The following is the output −

string(1) "A"
NULL
string(1) "^"
Updated on: 2019-12-30T08:29:27+05:30

77 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements