PHP script parsing. What we want to introduce today is: 1. PHP scripts have four types of tags: short tags and asp tags, which are easy to use but have poor portability and distribution. they are generally not recommended. Note that if we want to introduce PHP to you today1. PHP scripts have four types of labels: short labels and asp labels, which are convenient but have poor portability and release performance. they are generally not recommended. Note that if you embed PHP into XML or XHTML, you need to use standard labels. <? Php?> To maintain compliance with standards.
A, standard tag: <? Php...?>
B. script tag: <script language = "php">... </Script>
C. Short tag: <? ... ?> You need to set short _ open_tag = on in php. ini. the default value is on, or the-enable-short-tags option is added during PHP compilation. (PHP 3 can also use the short_tags () function to activate short tags .)
D, asp labels (supported after PHP 3.0.4): <%... %> You need to set asp_tags = on in php. ini. the default value is off.
2. PHP script command separator: like C, java, or Perl, PHP needs to end the command with a semicolon after each statement except the last line (because the end mark implies a semicolon. If the last line of the file is omitted, the output buffer and include () or require () are used ()
3. PHP script annotation: PHP supports C, C ++, and Unix Shell (Perl) annotations. For example:
Single line comment ://,#
Multi-line comment :/**/
- <? Php
- Echo "This is a test"; // Single line comment (c ++ style ),
- /* Multi-line comment: single-line comment description 1: "//?> "Medium?> Valid,
- Single line comment description 2: "// </script>" </script> invalid */
- Echo "This is yet another test ";
- Echo "One Final Test"; # single line comment (shell style)
- ?>
Protocol 1 and PHP scripts have four types of labels: short labels and asp labels, which are convenient but have poor portability and release performance, and are generally not recommended. In addition, note that if PHP...