sprintf()
functionsprintf($format, $val1[, val2] ...)
Character | Function |
---|---|
s | the value as a string |
d | the value as an integer |
f | the value as a floating-point number |
e | the value as a exponential |
c | an integer value as its ASCII character |
b | an integer value a binary number |
o | an integer value an octal number |
x | an integer value as a hexadecimal number (lowercase) |
X | an integer value as a hexadecimal number (uppercase) |
Specifier | Required? |
---|---|
% | yes |
sign | no |
alignment | no |
padding | no |
width | no |
precision | no |
data type | yes |