One, PHP script code tag
PHP script is a pair of special tags in the file included content, such as ASP is "<%....%>", PHP can be seen as "<?...? > ".
However, in order to adapt the XML standard to embed PHP in XML or XHTML, PHP does not recommend using short form "<?...? >, and recommended long format tags "<?php ...?" > "
In addition, the PHP code block also supports the <script language= "php" >...</script> tag form.
Two, PHP instruction separator
Each statement in PHP needs to be separated by a semicolon ";", but for the PHP closing tag "?>", it automatically implies a semicolon, so there is no need to append a semicolon.
So, the format of a PHP script can be as follows:
<?php
/*
............ ;
............ ;
............ ;
............
*/
Note that the last line can have no semicolon
?>
Three, PHP comments
PHP Multiline Annotations Use the "/* ... *"
Single-line comments Use "#" or "//"
Four, the output of PHP
In ASP, use the "<%=...%>" fast output line, or use "<%response.write" ("...")%> "
Use "echo ()" or "print ()" Directly in PHP, such as:
<?php
echo "a";
Echo (b);
Echo ("C");
Echo D;
?>
The output is "ABCD" and the above four types are normally output.
But this is in the ASP, especially echo "a"; and Echo D; is output to the string itself, and is not possible. This requires understanding the variable definition of PHP.