sprintf() returns a formatted string; printf() outputs a formatted string.
# b - the argument is treated as an integer, and presented as a binary number.
# c - the argument is treated as an integer, and presented as the character with that ASCII value.
# d - the argument is treated as an integer, and presented as a (signed) decimal number.
# e - the argument is treated as scientific notation (e.g. 1.2e+2). The precision specifier stands for the number of digits after the decimal point since PHP 5.2.1. In earlier versions, it was taken as number of significant digits (one less).
# u - the argument is treated as an integer, and presented as an unsigned decimal number.
# f - the argument is treated as a float, and presented as a floating-point number (locale aware).
# F - the argument is treated as a float, and presented as a floating-point number (non-locale aware). Available since PHP 4.3.10 and PHP 5.0.3.
# o - the argument is treated as an integer, and presented as an octal number.
# s - the argument is treated as and presented as a string.
# x - the argument is treated as an integer and presented as a hexadecimal number (with lowercase letters).
# X - the argument is treated as an integer and presented as a hexadecimal number (with uppercase letters).
Main Topics
Browse All Topics





by: angelIIIPosted on 2009-11-02 at 15:07:46ID: 25724737
the %s is a placeholder for the sprintf function, and to "format" the value as "string":
unction.sp rintf.php
http://php.net/manual/en/f