%
display a % character (no arg is required)
b
display arg as a binary integer
1111011
c
display ascii character for the arg
{
d
display arg as a signed decimal integer
123
e
display arg using scientific notation
1.23000e+2
f
display arg as floating point
123.000000
o
display arg as an octal integer
173
s
display arg as a string
123
u
display arg as an unsigned decimal
123
x
display arg as a lowercase hexadecimal
7b
X
display arg in uppercase hexadecimal
7B
sprintf
send the output to another variable rather than to the browser. useful for making conversions. for example:
$hexstring = sprintf(“%X%X%X”, 65, 127, 245);