Skip to content Skip to footer navigation
You are reading the docs for an old version of Statamic. Consider upgrading to Statamic 6.

String Pad Left Modifier

This modifier returns the string padded on the left to the specified padding length (paramameter 1) with a character of choice (parameter 2).

{{ 1 | str_pad_left(2,0) }}
{{ Statamic::modify(1)->strPadLeft([2, 0]) }}
01