Computer >> Computer tutorials >  >> Programming >> PHP

IntlChar isdefined() function in PHP


The IntlChar isdefined() function checks whether the entered value is defined or not.

Syntax

bool IntlChar::isdefined (val)

Parameters

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

Return

The IntlChar isdefined() function returns TRUE if val is a defined character.

Example

The following is an example −

<?php
   var_dump(IntlChar::isdefined("Z"));
   echo "<br>";
   var_dump(IntlChar::isdefined(" "));
   echo "<br>";
   var_dump(IntlChar::isdefined("HJHK"));
   echo "<br>";
   var_dump(IntlChar::isdefined("89"));
?>

Output

The following is the output −

bool(true)
bool(true)
NULL
NULL