valid_unicode

Helper function to determine if a Unicode value is valid.

Description

valid_unicode( (int) $i ); 

Parameters (1)

0. $i (int)
Unicode value

Usage

  1. if ( !function_exists( 'valid_unicode' ) ) { 
  2. require_once ABSPATH . WPINC . '/kses.php'; 
  3.  
  4. // Unicode value 
  5. $i = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = valid_unicode($i); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/kses.php  
  1. function valid_unicode($i) { 
  2. return ( $i == 0x9 || $i == 0xa || $i == 0xd || 
  3. ($i >= 0x20 && $i <= 0xd7ff) || 
  4. ($i >= 0xe000 && $i <= 0xfffd) || 
  5. ($i >= 0x10000 && $i <= 0x10ffff) );