{strtolower:string}

Description

Converts a string to lowercase and returns it. Letters change case; digits, spaces, and punctuation are left unchanged. On a UTF-8 install the lowercasing is Unicode-aware, so accented and non-Latin letters are lowercased too. The argument is not trimmed - any leading or trailing whitespace is kept. This is the template counterpart of PHP strtolower (mb_strtolower on a UTF-8 install). The mirror command strtoupper does the opposite.

Parameters

string required default (none)

The text to convert to lowercase. Returned with every letter lowercased; digits, spaces, and punctuation are unchanged. On a UTF-8 install the lowercasing is Unicode-aware (accented and non-Latin letters too). This argument is not trimmed - leading and trailing whitespace is kept.

Examples

test{strtolower:HELLO WORLD}
Expectedhello world
Actualhello world
Converts all characters in the string to lowercase. UTF-8 aware: accented and other multibyte letters are lowercased too. Digits, spaces, and punctuation are left unchanged.
test{strtolower:{replace:\s+:-:My Article Title}}
Expectedmy-article-title
Actualmy-article-title
Build a URL slug: first replace runs of whitespace with a hyphen, then lowercase the whole result. Nesting matters - the inner replace runs first, then strtolower wraps its output.
test{strtolower:PRILIS ZLUTOUCKY}
Expectedprilis zlutoucky
Actualprilis zlutoucky
On a UTF-8 install strtolower uses a Unicode-aware lowercasing, so accented and non-Latin letters are lowercased too - an uppercase A-acute becomes a-acute, an uppercase C-caron becomes c-caron. This example keeps to ASCII so the stored expected stays exact; accented characters are spelled out in prose because they do not round-trip through this install stored fields.
test[{strtolower: PADDED }]
Expected[ padded ]
Actual[ padded ]
strtolower does not trim its argument, so any leading or trailing spaces survive. The brackets here just make the kept spaces visible.
test{strtolower:CamelCase Text 123!}
Expectedcamelcase text 123!
Actualcamelcase text 123!
Only letters change case. Digits, spaces, and punctuation pass through unchanged.
test{ifeq:{strtolower:EN}:en:English content:Other language}
ExpectedEnglish content
ActualEnglish content
Lowercases a value before comparing it, so the match does not depend on how the source was capitalized. Here EN, En, and en all match en.