PHP | IntlChar::isIDPart() Function
The IntlChar::isIDPart() function is an inbuilt function in PHP which is used to check whether the given input character is permissible in an identifier or not. It is True for characters with general category “L” (Letters), “Nd” (Decimal digits), “Nl” (letters numbers), “Mc” and “Mn”(Combining marks), “Pc” (Connecting Punctuation) and u_isIDIgnorable(c).
Syntax:
bool IntlChar::isIDPart( $codepoint )
Parameters: This function accepts a single parameter $codepoint which is mandatory. The input parameter is a character or interger value, which is encoded as a UTF-8 string.
Return Value: If $codepoint is an identifier character then returns True, otherwise return False.
Below programs illustrate the IntlChar::isIDPart() Function in PHP:
Program 1:
<?php // PHP code to illustrate // IntlChar::isIDPart() function // Input character codepoint value var_dump(IntlChar::isIDPart("X")); // Input string codepoint value var_dump(IntlChar::isIDPart("Geeks")); // Input symbolic codepoint value var_dump(IntlChar::isIDPart("^ ")); // Input int codepoint value var_dump(IntlChar::isIDPart("3 ")); // Input int char an identifier // of codepoint value var_dump(IntlChar::isIDPart("\u{007F}")); var_dump(IntlChar::isIDPart("\u{012C}")); ?> |
Output:
bool(true) NULL NULL NULL bool(true) bool(true)
Program 2:
<?php // PHP code to illustrate // IntlChar::isIDPart() function // Declare an array with // different codepoint value $arr = array("D", "\u{007F}", ".", "8", "/", " " ); // For loop condition to check // each character through function foreach ($arr as $val) { // Check each element as code point data var_dump(IntlChar::isIDPart($val)); } ?> |
Output:
bool(true) bool(true) bool(false) bool(true) bool(false) bool(false)
Related Articles:
- IntlChar::isIDIgnorable() Function
- IntlChar::isUWhiteSpace() Function
- IntlChar::isWhitespace() Function
- IntlChar::isUUppercase() Function
Reference: http://php.net/manual/en/intlchar.isidpart.php
Recommended Posts:
- How to call a function that return another function in JavaScript ?
- How to get the function name from within that function using JavaScript ?
- PHP | Ds\Set contains() Function
- PHP | tan( ) Function
- p5.js | nf() Function
- p5.js | arc() Function
- PHP | exp() Function
- CSS | var() Function
- p5.js | red() function
- PHP | Ds\Set last() Function
- p5.js | min() function
- D3.js | d3.set.add() Function
- PHP | dir() Function
- CSS | hsl() Function
- p5.js | hue() 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.



