- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- 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::isxdigit() function in PHP
The IntlChar::isxdigit() function checks whether the given input character is a hexadecimal digit or not. The following are the hexadecimal digits −
Digit numbers (0 – 9)
Letters (a – f) and (A – F)
\u{0041} to \u{0046},
\u{0061} to \u{0066},
\u{FF21} to \u{FF26}
\u{FF41} to \u{FF46}).
Syntax
IntlChar::isxdigit( val )
Parameters
val − An integer values or character encoded as a UTF-8 string.
Return
The IntlChar::isxdigit() function returns TRUE if the val is a hexadecimal digit.
Example
The following is an example −
var_dump(IntlChar::isxdigit("10")); echo "<br>"; // Input data is character type var_dump(IntlChar::isxdigit("A")); echo "<br>"; var_dump(IntlChar::isxdigit("a")); echo "<br>";
Output
The following is the output −
bool(true) NULL bool(true)
Example
Let us see another example −
<?php var_dump(IntlChar::isxdigit("u{0041}")); echo "<br>"; var_dump(IntlChar::isxdigit("k")); echo "<br>"; var_dump(IntlChar::isxdigit("9")); echo "<br>"; ?>
Output
The following is the output −
bool(true) bool(false) bool(true)
Advertisements