Home

strtolower

strtolower is a built-in function in PHP that converts all alphabetic characters in a string to their lowercase equivalents. The transformation is locale-aware, meaning it follows the current locale’s rules for casing as defined by the runtime environment.

Syntax and behavior: string strtolower(string $string). The function returns the input string with ASCII letters converted

Caveats and alternatives: For UTF-8 and other multibyte encodings, strtolower may not reliably convert non-Latin characters.

Examples and usage considerations: strtolower('Hello World!') yields 'hello world!'. Developers should choose between strtolower and multibyte

to
lowercase,
and
it
may
handle
non-ASCII
characters
according
to
the
active
locale.
Because
it
depends
on
locale
settings,
results
can
vary
between
environments
or
configurations
set
with
setlocale
or
LC_CTYPE.
In
such
cases,
it
is
common
to
use
mb_strtolower($string,
'UTF-8'),
which
applies
multibyte-aware
casing
suitable
for
Unicode.
Regardless
of
approach,
strtolower
preserves
the
string
length
and
does
not
remove
or
add
characters.
alternatives
based
on
the
character
set
of
the
input
data
and
the
desired
locale
behavior.
In
contexts
requiring
consistent
Unicode
handling,
mb_strtolower
is
generally
preferred.