IntlChar tolower() function in PHP

The IntlChar::tolower() function converts a Unicode character to its lowercase equivalent. This function is part of PHP's Intl extension and works with Unicode codepoints and UTF-8 encoded characters.

Syntax

IntlChar::tolower(mixed $codepoint)

Parameters

  • codepoint − An integer representing a Unicode codepoint value, or a character encoded as a UTF-8 string.

Return Value

The function returns the lowercase equivalent of the given character. If the character is already lowercase or has no lowercase mapping, the same character is returned. Returns NULL on failure or for invalid input.

Example

The following example demonstrates converting various characters to lowercase ?

<?php
    // Converting uppercase letters
    var_dump(IntlChar::tolower("A"));
    echo "<br>";
    
    // Already lowercase letter
    var_dump(IntlChar::tolower("k"));
    echo "<br>";
    
    // Uppercase letter M
    var_dump(IntlChar::tolower("M"));
    echo "<br>";
    
    // Number (no case conversion)
    var_dump(IntlChar::tolower("5"));
    echo "<br>";
    
    // Using Unicode codepoint for 'Z' (90)
    var_dump(IntlChar::tolower(90));
?>

Output

string(1) "a"
string(1) "k"
string(1) "m"
string(1) "5"
string(1) "z"

Key Points

  • Only works with single characters, not strings

  • Returns NULL for multi-character strings or invalid input

  • Numbers and special characters remain unchanged

  • Supports Unicode codepoint integers as input

Conclusion

The IntlChar::tolower() function provides Unicode-aware lowercase conversion for individual characters. Use it when you need proper case conversion that handles international characters correctly.

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

108 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements