Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

strtolower()

strtolower() converts all ASCII alphabetic characters in a string to lowercase.

It only handles the 26 ASCII letters, from A to Z. Characters outside the ASCII range, such as accented letters or characters from non-Latin scripts, are not converted. For Unicode-aware lowercase, use mb_strtolower(), which respects the encoding of the string.

strtolower() is commonly used when comparing strings in a case-insensitive manner, building slugs, or normalising input.

<?php

    echo strtolower('Hello World');  // hello world
    echo strtolower('PHP 8.4');      // php 8.4

    // Unicode-aware version
    echo mb_strtolower('Héllo', 'UTF-8'); // héllo

?>

Documentation

See Also