IntlChar::isIDPart() function in PHP

The IntlChar::isIDPart() function is used to check whether the entered character is an identifier or not

Syntax

bool IntlChar::isIDPart(val)

Parameters

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

Return

The IntlChar::isIDPart()function returns TRUE if the entered value is an identifier character.

Example

The following is an example −

";
   var_dump(IntlChar::isIDPart("j"));
   echo "
";    var_dump(IntlChar::isIDPart("&"));    echo "
";    var_dump(IntlChar::isIDPart("12"));    echo "
"; ?>

Output

The following is the output −

bool(true)
bool(true)
bool(false)
NULL
Updated on: 2019-12-30T08:13:37+05:30

140 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements