2808 explained code solutions for 75 technologies


phpFormat string width with leading spaces


str_pad($str, 25, ' ', STR_PAD_LEFT);ctrl + c
str_pad

will add specified amount of characters to the string

$str

string to add leading spaces to

25

total length of resulting string with spaces added

' '

select space symbol (can specify any character here)

STR_PAD_LEFT

add spaces to the left side of the string