Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
IntlChar::isalnum() function in PHP
The IntlChar::isalnum() function is used to check the given input is an alphanumeric character or not. The alphanumeric character is a digit or letter.
Syntax
bool IntlChar::isalnum(val)
Parameters
val − An integer values or character encoded as a UTF-8 string.
Return
The IntlChar::isalnum()function returns TRUE if the val is alphanumeric.
Example
The following is an example −
<?php
var_dump(IntlChar::isalnum("$$"));
echo "<br>";
var_dump(IntlChar::isalnum("Jack Sparrow!"));
echo "<br>";
var_dump(IntlChar::isalnum("99"));
echo "<br>";
var_dump(IntlChar::isalnum("J"));
echo "<br>";
?>
Output
The following is the output −
NULL NULL NULL bool(true)
Example
Let us see another example −
<?php
var_dump(IntlChar::isalnum("#"));
echo "<br>";
var_dump(IntlChar::isalnum("1"));
?>
Output
The following is the output −
bool(false) bool(true)
Advertisements