The IntlChar::isbase() function is an inbuilt function in PHP which is used to check 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 mandotary. The input parameter is an integer or character, which is encoded as a UTF-8 string.
Return Value: If $codepoint is 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 programs illustrate the IntlChar::isbase() Function in PHP:
Program 1:
<?php // PHP code to illustrate IntlChar::isbase() // Function // Input data is character type var_dump(IntlChar::isbase("D")); // Input data is string type var_dump(IntlChar::isbase("Geeksforgeeks")); // Input data is integer type var_dump(IntlChar::isbase("234")); // Input data is special character type var_dump(IntlChar::isbase("*")); ?> |
Output:
bool(true) NULL NULL bool(false)
Program 2:
<?php //PHP code to illustrate isbase() // Declare an array $arr $arr = array("4", "20001111", "^", " ", "*", "GeeksforGeeks"); // Loop run for every array element foreach ($arr as $val){ // Check each element as code point data 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
Recommended Posts:
- How to Check a Function is a Generator Function or not using JavaScript ?
- How to call a function that return another function in JavaScript ?
- How to get the function name inside a function in PHP ?
- How to get the function name from within that function using JavaScript ?
- D3.js | d3.set.has() Function
- D3.js | d3.map.set() Function
- PHP | min( ) Function
- PHP | Ds\Map get() Function
- CSS min() Function
- p5.js | arc() Function
- PHP | Ds\Set last() Function
- PHP | Ds\Set first() Function
- PHP | exp() Function
- D3.js | d3.hsl() Function
- CSS | var() Function
- PHP | Ds\Set contains() Function
- p5.js | nf() Function
- D3.js | d3.set.add() Function
- CSS | hsl() Function
- PHP | max( ) Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

