PHP delimiter <<
韦小宝
Release: 2023-03-17 16:50:01
Original
1788 people have browsed it


PHPis a webprogramming language. During the programming process, you will inevitably encounter using echo to output large sections of html andjavascriptIn the case of scripts, if you use thePHPtraditional output method-output by string, there must be a large number ofescape charactersto correct the characters in the string. Escapespecial characterssuch as quotation marks to avoidsyntax 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 whyPHPintroduces a delimiter - at least a large part of the reason.

1. The function of the PHP delimiter is to output the things inside it as it is, including newline format and so on;
2. Anything in the PHP delimiter Special characters do not need to be escaped; the
PHP variablein the3.PHP delimiter will be replaced with its value normally.

The delimiter format in PHP is this:


#<< ……
Eof;

For example:


 //top:作用使得整个frameset都跳转 window.top.location.href = "$group_url/Manager/login";  eof; echo $js;
Copy after login

The above are the special delimiters in PHP. For more information, please go to

PHP Chinese websiteSearch

Related recommendations:

#php How to get remote image downloads and save them locally

PHP Export EXCEL Quick Development Guide

php Reference (&) Usage

The above is the detailed content of PHP delimiter <<

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!