echo 1; ]."/> echo 1; ].">

Home >Backend Development >PHP Problem >What are the ways to write php tags?

What are the ways to write php tags?

王林
王林Original
2021-09-28 16:47:496369browse

There are four ways to write the

php tag, namely: 1. []; 2. []; 3. [<% echo=""> ]; 4. [ 】.

What are the ways to write php tags?

The operating environment of this article: windows10 system, php 5.4&&php 7, thinkpad t480 computer.

I believe everyone knows that the beginning of php program is

  • Normal writing method

  • Short tag writing method, 5.4 Start

  • ##<% echo 1; %> asp style writing

  • Long tag writing method

  • The differences between different versions are as follows:

    The first way is normal writing, there is nothing to say.

    The second type requires the directive short_open_tag in the php.ini configuration file to be turned on before it is available, or the --enable-short-tags option is added when compiling PHP. As of PHP 5.4, the short form echo tag

    The third method is not recommended. It is a syntactic sugar writing method added for asp programmers to learn php. It needs to be opened through the directive asp_tags in the php.ini configuration file before it can be used.

    The fourth type is no longer parsed after php7.0.

    Recommended learning:

    php training

    The above is the detailed content of What are the ways to write php tags?. 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