PHP4 style of marking
1.XML style
<?phpecho "This is an XML style tag";? >
2. Scripting style
<script language= "php" >echo "This is a script style tag";</script>
3. Short style
<?echo "This is a short style tag";? >
4.ASP style
<%echo "This is an ASP style tag";%>
Comments
Single line://
Multiple lines:/*............*/
Scalar data types
Boolean (Boolean): Only 2 values, True (True) and False (false)
String (String type): Sequential string sequence
Integer (Integer): contains only integers
Float (floating point type): Real number
$ is a scalar identifier, and all variables start with the $ sign
3 Ways to define strings
1. Single quotation mark (')
<?php$a= ' strings ';? >
2. Double quotation marks (")
<?php$a= "string";? >
3. Delimiter (<<<)
<?php$string=<<<str string str //End qualifier must be another line?>
The difference between single and double quotes: single quotation marks are output by ordinary characters, and double quotes are the variables that are included replace them with actual values.
Escape character output extra "\"
Such as:
<?php$a= "string"; echo "\ $a"; echo "$a";? >
Output result: $a
Character connections (similar to Java (Java is +, here is.))
Such as:
<?php$a= "word"; echo "Hello". $a;? >
Output Result: Hello Word