Why does PHP sometimes not write closed tag terminator?
Find some information, everyone on the PHP closed tag summary is as follows:
Benefits: If this is a program that someone else contains, without this terminator, you can reduce a lot of
PHP implementation of closed HTML tags, PHP complement HTML tags
The example in this article describes the HTML tags that PHP implements to close. Share to everyone for your reference, as follows:
Most of the time, when we make a fuss about
Under what circumstances can not write PHP's closed tag "?>", do not write PHP
In some PHP projects we often see that some PHP files in the code is only the start tag, but not the end tag, then under what circumstances can not write the end tag,
The concept was first approached from Drupal, and at first it was a bit of a habit-why not write a closed tag? This feeling is not perfect, for people with obsessive-compulsive disorder is very not adapt to it! Later, in the work encountered because
When I started writing PHP code, I was going to write PHP closed tags, after a few years, habits changed, no longer write PHP tags.
The concept was first approached from Drupal, and at first it was a bit of a habit-why not write a closed tag? This
This concept was first approached from Drupal and was a bit unaccustomed at first-why not write a closed tag? It's not perfect, it's not suitable for people with obsessive-compulsive disorder. Later, in the work of the problem caused by the closure
PHP Tags
When parsing a file, PHP looks for the start and end tags, which is
PHP also allows the use of short tags. And, but not encouraged to use. Short tags can only be used if you activate the Short_open_tag configuration directive in php.ini
Project to be useful to the PHP yii framework, today read the canonical document
Https://github.com/yiisoft/yii/wiki/Core-framework-code-style
Inside it says: Php file just start tag
不要结束标签 ?>, 印象中好像有看到其他框架也这么说过, 貌似会更安全, 为什么, 哪里有相关介绍?
Reply
Joe Brockmeier briefly introduces the PHP scripting language, discusses the origin, performance, and application Platform of PHP. A simple example of a PHP script illustrates its basic syntax and usage.
If you are working on web-based development,
The number of PHP components and frameworks is incredibly large. There are mega-frameworks like Symfony and Laravel, as well as miniature frameworks like Silex and slim. There are even traditional frameworks that have existed long before modern PHP
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.