The built-in function usage of printf () for PHP string operations php indicates that many of the most common print output functions are echo print () printf () spintf.
The echo and print () functions are the same, but print () has the return
printf is often used in C, PHP, and the shell, especially in PHP, where there are several variants of printf: print, printf, sprintf, vprintf, vsprintf in these languages, printf is basically formatted output string, and basically is on the basis of
The advantage of the printf () function is that you can format the output!
Full format control for printf:
%-0 M.N L or H format characters
The following is a description of the constituent format description:
①%: Represents the starting symbol
Many of the most common functions in PHP that indicate printouts are the echo print () printf () spintf ().
The Echo and print () functions are the same, but print () has a return value (True and false) for execution success or not.
Using the
In-depth analysis of printf () function formatting in PHP, in-depth analysis of printf
The advantage of the printf () function is that it can format the output!
The complete format of printf format control:
%-0 m. n l or h characters
The following
The full format of printf format control:
%-0 M.N L or H format characters
The following describes the items that comprise the format description:
①%: Represents the starting symbol for the format description, which is indispensable.
②-:
1. Echo Function:The output function , which is a command, cannot return a value. Echo can be followed by a number of parameters, separated by semicolons, such as:echo $myvar 1;Echo, $myvar, "bold";2. print Function:is a function that returns a
Many of the most common functions in PHP that indicate printouts are the echo print () printf () spintf ().The Echo and print () functions are the same, but print () has a return value (True and false) for execution success or not.Using the function
Full format control for printf:
%-0 M.N L or H format characters
The following is a description of the constituent format description:
①%: Represents the starting symbol for the format description and is not missing.
②-: Has-represents the
A deep understanding of php printf () output formatted strings and a deep understanding of printf
The php printf () function is used to output formatted strings. This article describes how to use the php printf () function and the basic examples.
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.