The IntlChar::isgraph() function is an inbuilt function in PHP which is used to check the code point is a graphic character or not. It returns True for all characters except those with general categories Cc(control codes), Cf(format controls), Cs(surrogates), Cn(unassigned), and Z(separators).
Syntax:
bool IntlChar::isgraph ( $codepoint )
Parameters: This function accepts a single parameter $codepoint which is mandatory. The $codepoint value is an integer values or character, which is encoded as a UTF-8 string.
Return Value: This function returns True if $codepoint is a graphic character, False otherwise.
Below programs illustrate the IntlChar::isgraph() function in PHP:
Program 1:
<?php // PHP code to illustrate the // IntlChar::isgraph() function. // Alphabet cases var_dump(IntlChar::isgraph("c")); // Single digit var_dump(IntlChar::isgraph("4")); // UTF encoded string var_dump(IntlChar::isgraph("\u{2403}")); // new line character var_dump(IntlChar::isgraph("\n")); // vertical tab character var_dump(IntlChar::isgraph("\t")); ?> |
bool(true) bool(true) bool(true) bool(false) bool(false)
Program 2:
<?php // PHP code to illustrate isgraph() // Declare an array $arr $arr = array("Z", "291", "^", " ", "*", "Sudo Placement"); // Loop run for every array element foreach ($arr as $val){ // Check each element as code point data var_dump(IntlChar::isgraph($val)); } ?> |
bool(true) NULL bool(true) NULL bool(true) NULL
Related Articles:
Reference: http://php.net/manual/en/intlchar.isgraph.php
Recommended Posts:
- PHP | IntlChar::isJavaIDStart() Function
- PHP | IntlChar::isJavaSpaceChar() Function
- PHP | IntlChar::iscntrl() Function
- PHP | IntlChar::isdigit() Function
- PHP | IntlChar::isblank() Function
- PHP | IntlChar::isalpha() Function
- PHP | IntlChar::isbase() Function
- PHP | IntlChar::isalnum () Function
- PHP | IntlChar::isprint() Function
- PHP | IntlChar::isupper() Function
- PHP | IntlChar::islower() Function
- PHP | IntlChar::isxdigit() Function
- PHP | IntlChar::ispunct() Function
- PHP | IntlChar::isspace() Function
- PHP | IntlChar::isUUppercase() Function
- PHP | IntlChar::isWhitespace() Function
- PHP | IntlChar::charDigitValue() Function
- PHP | IntlChar::isIDIgnorable() Function
- PHP | IntlChar::charName() Function
- PHP | IntlChar::charMirror() 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.


