This article mainly introduces common php string output methods, and analyzes the specific usage and usage of echo, print, printf, and sprintf output strings in the form of examples, for more information about php string output, see the following
the difference between print, printf, and println in Javaprintf is mainly inherited by the C language of printf Some of the features, can be formatted outputPrint is the normal standard output, but does not break the lineprintln and print basically
Original: PHP basic review of Echo print printf sprintf print_r var_dump usage and differencesFirst, EchoEcho () is not actually a function, it is a PHP statement, so you do not need to use parentheses on it. However, if you want to pass more than
This article mainly analyzes the differences and usage between echo, print, printf, and sprintf functions in PHP. If you need some help, please refer to them.
This article mainly analyzes the differences and usage between echo, print, printf, and
Echo ()Multiple values can be output at one time, and multiple values are separated by commas. Echo is a language structure (language construct), not a real function and therefore cannot be used as part of an expression.Print ()The function print ()
PHP basics echo print printf sprintf print_r var_dump usage and difference, print_rvar_dump1. echoEcho () is actually not a function, it is a php statement, so you do not need to use parentheses for it. However, if you want to pass more than one
Difference between echo, print, printf and sprintf-echo
It is a command and cannot return values. Echo can be followed by multiple parameters separated by semicolons, for example:
Echo $ myvar1;
Echo 1, 2, $ myvar, "bold ";
-Print
Yes.
Here's a description.
1. Echo
echo is a keyword in PHP that has no return value. In the notation, it can omit parentheses. The following code:
Copy the Code code as follows:
Echo ' Test String ';Echo (' Test String ');
2. Print
Print is also a
The differences and usage between PHPecho, print, printf, and sprintf functions are described in detail. 1. echo function: output function, which is a command and cannot return values. Echo can be separated with multiple parameters by semicolons,
PHP learning output string (echo, print, printf, print_r and var_dump ). The following is a one-to-one introduction. 1. echoecho is a keyword of PHP, and it does not return a value. In terms of writing, it can omit parentheses. The following code:
the commonly used string output in PHP is: use the Echo and print two methods to display the string. You can also try the printf and sprintf functions if the format output operation is involved. First, say Echo and print two ways
The syntax
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
A detailed explanation of the differences between print, printf, and println in Javaprintf mainly inherits some of the features of the C language printf, which can be formatted for output
Print is the normal standard output, but does not
This article mainly analyzes the differences and usage between echo, print, printf, and sprintf functions in PHP. if you need some help, please refer to them.
1. echo function:
The output function is a command and cannot return values. Echo can be
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
PHP Basics Review the use and difference of echo print printf sprintf print_r var_dump
First, EchoEcho () is not actually a function, it is a PHP statement, so you do not need to use parentheses on it. However, if you want to pass more than one
In PHP, there are four methods to output strings. The echo structure can output multiple values at a time; print () can only output one value; printf () can format the output; print_r () can output arrays, which is very beneficial for debugging.
In
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
The following is a one-to-one introduction.
1. echoEcho is a keyword of PHP, and it does not return a value. In terms of writing, it can omit parentheses. The following code:
Copy codeThe Code is as follows: echo 'test string ';
Echo ('test string '
Printf inherits some features of the C language printf and can be formatted and output.Print is the standard output, but does not wrapThere is basically no difference between println and print, that is, the last line break.System. out. printf ("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.