Simply summarize the differences between Echo () and the easy-to-confuse functions like print (), require (), and include ()
The difference between 1.echo and print
The functions of Echo and print in PHP are basically the same (output), but there
[Php] the core functions of echo and var_dump echo are the same as those of var_dump. they are all "output variable values". however, echo tends to be a product, debugs and programmers are more suitable to use var_dump to output variables. when
echo "Hello" output is garbled, the following are written.
Add in HTML
Add header ("Content-type:text/html;charset=utf-8") to PHP;
Apache configuration file in Adddefaultcharset utf-8
Can still be garbled, what else is possible?
echo '';
Why does the $row in value in this code use the word '. ' Wrap it up.
Reply content:
echo '';
Why does the $row in value in this code use the word '. ' Wrap it up.
[.]Strings can be stitched together in PHP!For example$a =
$.post (' index.php?act=q&openid=
', {' QNumber ': qnumber},function (data) {}, ' json '), where is index.php the current page? or the page that submitted the JSON?
Reply to discussion (solution)
index.php should be the current pageBut for
/*******echo********/echo-output one or more strings
descriptionEcho (String arg1 [, String ...])
Echo () is not actually a function (it is a language structure), so you do not need to use parentheses. Echo () (unlike some other language constructs)
It's weird. I echo every HTML when it's echo "
"; It's supposed to be a blue flag, but I have a blue one and grey is what's going on.
Reply to discussion (solution)
Your code is not escaped.
echo "
";//or use single quote
1. echo function:
The output function 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 ";
2. print function:
Yes. One value can be
/******* Echo ********/Echo-output one or more stringsDescriptionEcho (string arg1 [, string...])Echo () is actually not a function (it is a language structure), so you do not need to use parentheses. Echo () (unlike some other languages) is not
The difference between 1.echo and print
The functions of ECHO and print are essentially the same in PHP (output), but there is a slight difference between the two. echo output does not return a value, but print has a return value that returns Flase
/*******echo********/echo-output one or more stringsDescribeEcho (String arg1 [, String ...])Echo () is not actually a function (it is a language structure), so you do not need to use parentheses. Echo () (unlike some other language constructs) is
1. Echo Function:
The output function, which is a command, cannot return a value. Echo can be followed by many parameters, separated by semicolons, such as:echo $myvar 1;Echo 1,2, $myvar, "bold";
2. Print function:
is a function that can return a
In general, the dynamic output of HTML content in PHP is achieved through print and ECHO statements, and in practice, both print and ECHO functions are almost identical. It can be said that there is a place to use, and the other can be used. However,
Copy codeThe Code is as follows:Echo "asd"; // stringEcho "ads $ c"; // string + variableEcho 'ads $ C'; // string asd $ c is not a variableEcho "sd". "";Echo "sd", "";Echo $;Echo $ a. $ B;Echo $ a, $ B;Echo $ a. $ B. $ c;Echo $ a, $ B, $ c;Echo
1. Differences between echo and print
The echo and print functions in PHP are basically the same (output), but there are still slight differences between the two. No return value after echo output, but print has a return value. If the execution
I wanted to copy a piece of json to my server today, but I found the problem after echo, saying PHPParseerror: syntaxerror, unexpectedcomic (T_STRING) inC: websoftwebphpwindappu17testcomic. the problem with phponline3 is that I explicitly requested
Using the Yii layout, add this sentence, it will automatically add a div package on the sub-page, and the div ID named Id=content, this and the existing ID is duplicated, how to
Echo (), print (), print_r () usage in php. My understanding of the echo (), print (), print_r () function is that echo can input string variable constants, and print is similar to echo, however, print_r can print arrays, but the first two are not
(Transfer) accelerate PHP's ECHOhttp: // redirect (transfer) accelerate PHP's ECHO
Http://www.laruence.com/2011/02/13/1870.html
You may have noticed that when using ECHO in PHP to output a large string, the execution time is obviously long, and
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.