Get the App
SLTechnology News&Howtos  ›  Development  › 

What are several tags of PHP scripts?

Shulou Source: shulou.com Published: 2022-06-03 04:24:43 11月01日 Update

This article introduces what are several marks of PHP script, the content is very detailed, interested friends can refer to, hope to be helpful to you.

What we are going to introduce to you today is the knowledge about PHP scripts. I hope it will be helpful to the students who are new to the PHP language and improve our understanding of the PHP language.

1. There are four kinds of tags in PHP scripts: short tags and asp tags are convenient, but their portability and popularity are poor, and they are usually not recommended. Also note that if you embed PHP into XML or XHTML, you need to use standard tags

< ?php ?>

To keep up with the standards.

A, standard label:

< ?php .. ?>

B, script label:

< script language="php">

...

< /script>

C, short label:

< ? … ?>

You need to set short _ open_tag=on in php.ini, which defaults to on, or adds the-enable-short-tags option when PHP is compiled. (the PHP 3 version can also activate the use of short tags through the short_tags () function.)

D, asp tag (supported after PHP version 3.0.4): you need to set asp_tags=on in php.ini. Default is off.

2, PHP script instruction delimiter: like CMagnejava or Perl, PHP needs to end the instruction with a semicolon after each statement except the last line (because the closing tag implies a semicolon). Omitting the semicolon at the end of the file facilitates the use of output buffering and include () or require ()

3, PHP script comments: PHP supports comments in both CJE and Unix Shell style (Perl style). For example:

One-line comment: / /, #

Multiline comments: / * /

< ?php echo "This is a test"; // 单行注释 (c++ 风格), /* 多行注释:单行注释说明1:"// ?>

"medium? > valid, single-line comment 2:" / /

< /script>

"in

< /script>

Invalid * / echo "This is yet another test"; echo "One Final Test"; # single-line comments (shell style)? > this is the end of what are several tags for PHP scripts. I hope the above can be helpful and learn more. If you think the article is good, you can share it for more people to see.

Tags: Scripts tags comments tags semicolons standards styles help content instructions more knowledge language middleware support good effective poor interest function Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Shulou Information NVidia Xiaomi MySQL