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) "^"

karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know

Updated on: 30-Dec-2019

33 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements