strtolower

(PHP 4, PHP 5, PHP 7, PHP 8)

strtolowerMake a string lowercase

Опис

strtolower(string $string): string

Returns string with all ASCII alphabetic characters converted to lowercase.

Bytes in the range "A" (0x41) to "Z" (0x5a) will be converted to the corresponding lowercase letter by adding 32 to each byte value.

This can be used to convert ASCII characters within strings encoded with UTF-8, since multibyte UTF-8 characters will be ignored. To convert multibyte non-ASCII characters, use mb_strtolower().

Параметри

string

The input string.

Значення, що повертаються

Returns the lowercased string.

Журнал змін

Версія Опис
8.2.0 Перетворення регістру більше не залежить від локалі, що встановлена функцією setlocale(). Перетворюються тільки ASCII-символи.

Приклади

Приклад #1 strtolower() example

<?php
$str
= "Mary Had A Little Lamb and She LOVED It So";
$str = strtolower($str);
echo
$str; // Prints mary had a little lamb and she loved it so
?>

Примітки

Зауваження: Ця функція є бінарно безпечною.

Прогляньте також

  • strtoupper() - Створює рядок у верхньому регістрі
  • ucfirst() - Make a string's first character uppercase
  • ucwords() - Uppercase the first character of each word in a string
  • mb_strtolower() - Make a string lowercase