The IntlChar::istitle function is an inbuilt function in PHP which is used to check whether the input character code point is a titlecase letter or not. In True cases, the characters with the general category are “Lt” (titlecase letter).
Syntax:
bool IntlChar::istitle( $codepoint )
Parameters: This function accepts a single parameter $codepoint which is mandatory. The input parameter $codepoint is a character or integer value, which is encoded as a UTF-8 string.
Return Value: Returns True, if $codepoint is a titlecase letter, otherwise return False.
Below programs illustrate the IntlChar::istitle() Function in PHP:
Program 1:
php
<?php
var_dump(IntlChar::istitle( "Welcome to Geeks" ));
var_dump(IntlChar::istitle( "\u{03A6}" ));
var_dump(IntlChar::istitle( "?" ));
var_dump(IntlChar::istitle( "\u{00A0}" ));
var_dump(IntlChar::istitle( " " ));
var_dump(IntlChar::istitle( " ^ " ));
var_dump(IntlChar::istitle( "3" ));
?>
|
Output: NULL
bool(false)
bool(false)
bool(false)
bool(false)
NULL
bool(false)
Program 2:
php
<?php
$arr = array ( "G" ,
"\u{03C6}" ,
"\t" ,
);
foreach ( $arr as $val ) {
var_dump(IntlChar::istitle( $val ));
}
?>
|
Output: bool(false)
bool(false)
bool(false)
Reference: https://www.php.net/manual/en/intlchar.istitle.php