Sprintf format
Sprintf format
The sprintf format of Ruby is basically the same as that of C language sprintf (3. But there are still some differences: it does not have modifiers for C-specific types, such as short or long; it contains 2-digit
Sprintf function usage in PHP and sprintf Function
This article describes the usage of sprintf functions in PHP. Share it with you for your reference. The usage analysis is as follows:
The sprintf () function is officially used to format and output
sprintf function PHP's detailed use method, sprintf function php
PHP sprintf () function
First of all, why write the preface to this function, this is I developed in two times a token verification document is a sample document see a function, then
This article mainly introduces the sprintf function usage in PHP, and analyzes the common usage of sprintf function formatting and output in the form of instances in detail, which has some reference value, for more information about sprintf
This article mainly introduces the sprintf function usage in PHP, and analyzes the common usage of sprintf function formatting and output in the form of instances in detail, which has some reference value, for more information about sprintf
This example describes the use of sprintf functions in PHP. Share to everyone for your reference. The specific usage analysis is as follows:
sprintf () function in the PHP official is said that the string format output, this article will give you
The PHP function sprintf () function is officially defined as: sprintf (): Writes a format string to a variable
The syntax is:sprintf (format,arg1,arg2,arg++);
Parameters:Format: must, convert formattingArg1: Must, specify the parameter to insert
$bookSQL =sprintf ("UPDATE book SET pass=%s WHERE id=%d",
Getsqlvaluestring ($_post[' list '], "text"),
Getsqlvaluestring ($_get[' id '], "int"));
Getsqlvaluestring This function can be replaced by other functions
But here's the function of sprintf (
1. Percent: replace% to%
$STR = ' Test the percent of this parameter, what will be replaced by ';
echo sprintf ($STR);
Return result: Test the% of this parameter, which will be replaced by what (percent is replaced by a%)
2. %b:
The following is a detailed analysis of the use and distinction of printf (), sprintf (), scanf (), sscanf () in the C language, and the need for friends can refer to the following
PrintfSyntax:#include int printf (const char *format, ...);The
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.