Home  >  Article  >  Backend Development  >  what is php tag

what is php tag

(*-*)浩
(*-*)浩Original
2019-10-10 10:43:255156browse

When parsing a file, PHP looks for start and end tags, namely 815b22acdbf9dab14aa760b8cd72f36d, which tell PHP to start and stop parsing the code in between.

what is php tag

This parsing method allows PHP to be embedded in various documents, and any part other than the start and end tags will be Ignored by the parser.

PHP also allows the use of the short tags c591142d12d44772f043be014d650196, but their use is discouraged. (Recommended learning: PHP video tutorial)

Only by activating the short_open_tag configuration directive in php.ini or using the configuration option --enable-short-tags when compiling PHP Short tags can only be used when

If the file content is pure PHP code, it is best to remove the PHP closing tag at the end of the file.

This can avoid that if spaces or newlines are accidentally added after the PHP end tag, PHP will start to output these spaces, and there is no intention to output them in the script at this time.

<?php
echo "Hello world";

// ... more code

echo "Last statement";

// 脚本至此结束,并无 PHP 结束标记

The above is the detailed content of what is php tag. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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