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.

Updated on: 2026-03-15T07:44:49+05:30

152 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements