Standard tags: <? Php?>
short tags: <??> need in php.ini settings short _open_tag = on, the default is on
asp tags: <%%> need in php.ini settings asp_tags = on, is off by default
script tags: <script language="php"> </ script>
2, PHP variables and data types
1) $ variable, variable to the letter, _, there can be no space
2) assignment $ variable = value;
3) the weak type, direct assignment, the statement need not show the type of data
4) The basic data types: Integer, Double, String, Boolean, Object (object or category), Array (array)
5) special data types: Resourse (for third-party resources (such as databases) quoted), Null (air, an uninitialized variables)
3, operator
1) assignment operators: =
2) arithmetic operators :+,-,*,/,%( from Die)
http://www.phpsu.com
3) connected operators:., No matter what the number of operations, as a String, results returned String
4) Combined Assignment Operators together assignment operator :+=,*=,/=,-=,%=,.=
5) Automatically Incrementing and Decrementing automatically change operators:
(1) $ variable + = 1 <=> $ variable + +; $ variable-= 1 <=> $ variable-, c with the same language,先做other operations, after + + or --
(2) + + $ variable, - $ variable, to + + or - and do other operations
6) compared operators: = = (equivalent to the left side of the right ),!=( the left does not mean that right), = = = (equivalent to the right of the left, and the same type of data ),>=,>,<,<=
7) logical operator: | | ó or, & & óand, xor (about when the two sides and there is only one true, to return to true),!
4, Notes:
Single Note: / /, #
Multi-line Notes: / * * /
5, with each statement; at the end of the same java
6, defined constants: define ( "CONSTANS_NAME", value)
7, print statement: print, the same language and c
8, process control sentence
1) if statement::
(1)if(expression)
{ phpsu.com
//code to excute if expression evaluates to true
}
(2)if(expression)
do you kown phpsu.com?
{ do you kown phpsu.com?
phpsu
}
else
phpsu
{ welcome to phpsu.com
http://www.phpsu.com
}
(3)if(expression1) www.phpsu.com
{ phpsu is a phpschool
}
phpsu is a phpschool
elseif(expression2) www.phpsu.com
{
welcome to phpsu.com
} http://www.phpsu.com
else phpsu.com is a free phpscool
{ phpsu提供的php教程
}
http://www.phpsu.com
2)swich Statements
switch ( expression )
{
case result1: phpsu is a phpschool
// execute this if expression results in result1
do you kown phpsu.com?
break;
case result2:
// execute this if expression results in result2 http://www.phpsu.com
break; www.phpsu.com
default: phpsu
// execute this if no break statement
phpsu.com
// has been encountered hitherto
phpsu提供的php教程
}
TITLE:PHP dynamic web-based learning Notes