If you use the traditional output method - output by string, you must have a large number of escape characters to escape special characters such as quotation marks in the string to avoid syntax errors. If it is one or two places, it can be tolerated, but if it is a complete html text or a 200-line js, I think everyone will collapse. This is why PHP introduces a delimiter - at least a large part of the reason.
1. The function of the PHP delimiter is to output what is inside it as it is, including newline format and so on;
2. Any special characters in the PHP delimiter do not need to be escaped;
3.PHP definition PHP variables within delimiters will be replaced with their values normally.
The delimiter format in PHP is like this:
Copy the code The code is as follows:
<<
Eof;
Copy the code The code is as follows:
<<< ;Eof
hello{$name}
Eof;
Copy the code The code is as follows:
<<
Eof;
Copy code The code is as follows:
$name = 'kitty';
echo <<
{$name}
Win10 taskmgr.exe file application error solution
How to read macro control data in javascript
How to create a WeChat clone
The server cannot be found on the computer solution
The difference between xdata and data
How to execute scheduled tasks in java
How to set both ends to be aligned in css
Introduction to the opening location of win8 running