Skip to content

Glossary: PHP Basics

printf() / sprintf()

Also written: printf, sprintf

Functions that fill `%` placeholders such as `%s`, `%d` and `%.2f` in a format string, with widths for aligning columns. `printf` prints the result and `sprintf` returns it.

Where the book teaches it

Related terms

placeholder