Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
IntlChar::isIDIgnorable() function in PHP
The IntlChar::isIDIgnorable() function is used to determine whether the entered character is an ignorable character in Unicode identifiers or not. Ignorable characters are those that should be ignored when parsing identifiers in programming languages.
Syntax
bool IntlChar::isIDIgnorable(mixed $codepoint)
Parameters
codepoint − A character or integer value encoded as UTF-8 string, or an integer representing the Unicode code point.
Return Value
The IntlChar::isIDIgnorable() function returns TRUE if the character is an ignorable character, FALSE otherwise. Returns NULL on failure.
Example
The following example demonstrates how to check various characters ?
<?php
// Check ampersand character
var_dump(IntlChar::isIDIgnorable("&"));
echo "<br>";
// Check DELETE character (U+007F)
var_dump(IntlChar::isIDIgnorable("\u{007F}"));
echo "<br>";
// Check regular letter
var_dump(IntlChar::isIDIgnorable("A"));
echo "<br>";
// Check FORMAT character (U+00AD - soft hyphen)
var_dump(IntlChar::isIDIgnorable("\u{00AD}"));
?>
bool(false) bool(true) bool(false) bool(true)
Key Points
- Control characters like DELETE (U+007F) are typically ignorable
- Format characters like soft hyphen (U+00AD) are ignorable
- Regular letters, digits, and punctuation are not ignorable
- This function is useful for identifier parsing in internationalized applications
Conclusion
The IntlChar::isIDIgnorable() function helps identify Unicode characters that should be ignored when processing identifiers, making it valuable for internationalized text processing and parser development.
