The IntlChar::isalnum() function is an inbuilt function in PHP which is used to check the given input is an alphanumeric character (Digit or Letter) or not. It returns TRUE for characters with general categories “L” (letters) and “Nd” (decimal digit numbers).
Syntax:
bool IntlChar::isalnum( $codepoint )
Parameters: This function accepts single parameter $codepoint which is mandotary. The input parameter is an integer values or character, which is encoded as a UTF-8 string.
Return Value: If $codepoint is alphanumeric character then it returns True, otherwise returns False.
Program 1:
<?php // PHP code to illustrate IntlChar::isalnum() // Function // Input data is character type var_dump(IntlChar::isalnum("D")); // Input data is string type var_dump(IntlChar::isalnum("Geeksforgeeks")); // Input data is integer type var_dump(IntlChar::isalnum("234")); // Input data is special character type var_dump(IntlChar::isalnum("*")); ?> |
Output:
bool(true) NULL NULL bool(false)
Program 2:
<?php // PHP code to illustrate IntlChar::isalnum() // function // 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::isalnum($val)); } ?> |
Output:
bool(true) NULL bool(false) NULL bool(false) NULL
Related Articles:
- PHP | IntlChar::isalpha() Function
- PHP | IntlChar::isdigit() Function
- PHP | IntlChar::isblank() Function
- PHP | IntlChar::isbase() Function
Reference: http://php.net/manual/en/intlchar.isalnum.php
Recommended Posts:
- How to get the function name inside a function in PHP ?
- PHP 5 vs PHP 7
- PHP | Get PHP configuration information using phpinfo()
- PHP | php.ini File Configuration
- How to import config.php file in a PHP script ?
- PHP | imagecreatetruecolor() Function
- PHP | fpassthru( ) Function
- PHP | ImagickDraw getTextAlignment() Function
- PHP | Ds\Sequence last() Function
- PHP | Imagick floodFillPaintImage() Function
- Function to escape regex patterns before applied in PHP
- PHP | array_udiff_uassoc() Function
- PHP | geoip_continent_code_by_name() Function
- PHP | GmagickPixel setcolor() function
- PHP | opendir() Function
- PHP | cal_to_jd() Function
- PHP | stream_get_transports() Function
- PHP | Ds\Deque pop() Function
- PHP | SimpleXMLElement children() Function
- PHP | array_intersect_ukey() 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.

