PHP IntlChar::isbase() function is an inbuilt function in PHP that is used to check whether the given input data is a base character or not. If the specified code point is a base character then it returns TRUE for general categories “L” (Letters), “N” (numbers), “Mc” (spacing combining marks), and “Me” (enclosing marks).
Syntax:
bool IntlChar::isbase( $codepoint )
Parameters: This function accepts a single parameter $codepoint which is mandatory. The input parameter is an integer or character, which is encoded as a UTF-8 string.
Return Value: If $codepoint is the base character then it returns TRUE, otherwise return FALSE.
Examples:
Input :(IntlChar::isbase("D"))
Output : bool(true)
Input : (IntlChar::isbase("*"))
Output : bool(false)
Input :(IntlChar::isbase("9"));
Output :bool(true)
Below examples illustrate the IntlChar::isbase() Function in PHP:
Example 1:
php
<?php
var_dump(IntlChar::isbase( "D" ));
var_dump(IntlChar::isbase( "Geeksforgeeks" ));
var_dump(IntlChar::isbase( "234" ));
var_dump(IntlChar::isbase( "*" ));
?>
|
Output:
bool(true)
NULL
NULL
bool(false)
Example 2:
php
<?php
$arr = array ( "4" , "20001111" , "^" , " " , "*" , "GeeksforGeeks" );
foreach ( $arr as $val ){
var_dump(IntlChar::isbase( $val ));
}
?>
|
Output:
bool(true)
NULL
bool(false)
NULL
bool(false)
NULL
Related Articles:
Reference: http://php.net/manual/en/intlchar.isbase.php
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
03 Apr, 2023
Like Article
Save Article