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}
How to solve the invalid mysql identifier error
linux scheduled shutdown command
What does full-width and half-width mean?
How to install chatgpt on mobile phone
What is email
Solution to failed connection between wsus and Microsoft server
What interface is audio?
The difference between vscode and visual studio