IntlChar getUnicodeVersion() function in PHP

The IntlChar getUnicodeVersion() function is used to get the Unicode version that the ICU library is using. It returns an array containing version numbers that represent the Unicode standard version.

Syntax

array IntlChar::getUnicodeVersion()

Parameters

This function takes no parameters.

Return Value

The IntlChar getUnicodeVersion() function returns an array containing four integers representing the Unicode version number in the format [major, minor, micro, update].

Example

The following example demonstrates how to get the Unicode version ?

<?php
    var_dump(IntlChar::getUnicodeVersion());
?>

The output of the above code is ?

array(4) { [0]=> int(6) [1]=> int(3) [2]=> int(0) [3]=> int(0) }

Understanding the Output

The returned array contains four elements representing the Unicode version:

  • Index 0: Major version number

  • Index 1: Minor version number

  • Index 2: Micro version number

  • Index 3: Update version number

In the example output, the version array [6, 3, 0, 0] represents Unicode version 6.3.0.0.

Conclusion

The IntlChar::getUnicodeVersion() function is useful for determining which Unicode standard version your PHP installation supports, helping ensure compatibility when working with international characters and text processing.

Updated on: 2026-03-15T07:50:42+05:30

83 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements