strtolower()¶
strtolower() converts all ASCII alphabetic characters in a string to lowercase.
It only handles the 26 ASCII letters (A–Z). Characters outside the ASCII range, such as accented letters or characters from non-Latin scripts, are not converted. For Unicode-aware lowercasing, 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
?>
See also PHP strtoupper() and strtolower() Functions: A Complete Guide.
Related : strtoupper(), String, Case Sensitivity, Slug, Multibyte String, Idempotent, setlocale