IntlChar::isalnum() function in PHP

The IntlChar::isalnum() function is used to check the given input is an alphanumeric character or not. The alphanumeric character is a digit or letter.

Syntax

bool IntlChar::isalnum(val)

Parameters

  • val − An integer values or character encoded as a UTF-8 string.

Return

The IntlChar::isalnum()function returns TRUE if the val is alphanumeric.

Example

The following is an example −

";
   var_dump(IntlChar::isalnum("Jack Sparrow!"));
   echo "
";    var_dump(IntlChar::isalnum("99"));    echo "
";    var_dump(IntlChar::isalnum("J"));    echo "
"; ?>

Output

The following is the output −

NULL
NULL
NULL
bool(true)

Example

Let us see another example −

";
   var_dump(IntlChar::isalnum("1"));
?>

Output

The following is the output −

bool(false)
bool(true)
Updated on: 2019-12-30T07:36:57+05:30

209 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements