PHP markup Style:
< span="">
Recommended markup style that can be used in XML documents
'XML Style
';?> < span=""> < span="">
'Short Style
';?> < span=""> < span=""> ' < span=""> ASP Style
'; %>< span="">< span="">
< span="">
< span="">
< span="">< span="">< span="">
< span="">< span="">< span="">
< span="">), all content is commented before.
In the following example< span="">, "" will be treated as HTML because he is outside the closing tag
< span="">Here's HTML
< span="">
< span="">< span="">< span="">< span="">< span="">< span="">[' Name< span="">< span="">' [' < span=""> < span=""> name '] [' < span="">name' [' name '];< span=""> < span=""> < span="">
< span="">
/*short Style
Form variables are automatically converted to global variables and may encounter program errors that undermine script security
Assigning an initial value to a variable that is used to respond to its own
*/
Involves retrieving a variable from one of the $_post, $_get, or $_request arrays
These three arrays are called Super Global (Superglobal) variables
The choice< span="">of $ $_get depends on the method of submitting the form (POST or GET), < span=""> But both are available through [' Name '] Get Data
*/
Obsolete, can improve performance when disabled
*/
< span="">
< span="">
< span="">"Character string"
Single quotation mark (')' Character String ' < span="">
<<<< span="">
< span=""> after introduction ) < span="">
Echo<<< "< span="">
(introduced after PHP5.3.0) < span=""><<< ' EOT 'eot;
1. Single quote
to express a single quotation mark itself, you need to precede it with a backslash ( \ ) to escape, to express a backslash itself, two backslashes ( \ \ ).
the backslash in any other way will be treated as a backslash itself,
such as \ r or \ n , which does not represent any special meaning, simply the two characters themselves.
2. Double quotation marks
string is enclosed in double quotation marks ("), and PHP parses some special characters
3.Heredoc structure
<< <, after the operator is provided with an identifier (, then wraps,
follows the string itself, and
ends with the previously defined identifier as the end flag.
Considerations
1. Double quotation marks and heredoc structure are interpolated []
2. With single quotes, the difference between heredoc syntax and Nowdoc syntax, and the efficiency problem:
because the double quote/heredoc syntax is interpolated, the fields are interpreted by the compiler, and then as HTML code output;
and single quotes/ The fields within the Nowdoc syntax are not interpreted and are output directly.
3.Heredoc Structure The identifier referenced at the end of the/NOWDOC structure must be in the first column of the row, and the
end identifier may not contain any other characters except for a semicolon (;),
and there can be no whitespace or tabs before and after the semicolon.
* Take extra care when you have complex variables in the HEREDOC structure
4.php5.3.0, Heredoc structure :
< span="">< span="">< span="">< span="">< span="">< span="">= <<<< span="">... < span="">< span="">< span="">< span="">< span="">< c25> BAR < span=""> < span=""> = <<< < span=""> < span=""> = < span=""> <<<< span="">
< span="">< span="">< span="">< span="">= <<< ' EOT '< span="">
< span="">Attachment: Escape character
\ nthe newline (LF or 0x0A (10) in the ASCII character set)
\ r Enter (CR or 0x0D (13) in the ASCII character set)
\ t horizontal tab (HT or 0x09 (9) in the ASCII character set)
\v Vertical tab (VT or 0x0B (11) in the ASCII character set) (since PHP 5.2.5)
\e Escape (ESC or 0x1B (27) in the ASCII character set) (since PHP 5.4.0)
\f (FF or 0x0C (12) in the ASCII character set) (since PHP 5.2.5)
\ \ Backslash
\$ Dollar Mark
\ " double quotation marks
\[0-7]{1,3} matches the regular expression sequence with a character that is expressed in eight binary ways
\x[0-9a-fa-f]{1,2} matches the regular expression sequence with a character that is expressed in 16 binary ways
*/
< span="">
< span="">< span="">< span="">< span="">< span="">< span="">< span="">
# < span=""> Deep learning of variable parsing
< span="">
http://www.bkjia.com/PHPjc/626599.html www.bkjia.com true http://www.bkjia.com/PHPjc/626599.html techarticle PHP Markup Style://Recommended markup style that can be used in XML documents? PHP ' Pxml style/p ';?? ' Pshort style/p ';? % ' pAsp style/p '; % script language= ' Php;echo ' pscript style/p ...