Below a brief introduction to PHP syntax.
1, embedded:
ASP similar to the <%, PHP can be <? Php or < », the end symbol is«>, of course, you can also specify their own.
2, cited documents:
The paper quoted two ways: require and include.
require the use of methods such as require ( “MyRequireFile.php”);. This function is usually placed on top of the PHP process, PHP in the implementation of procedures before the first reading would require the introduction of the specified documents, PHP so that it becomes a part of the page program. Commonly used functions, this method will also be introducing its pages.
include the use of methods such as the include ( “MyIncludeFile.php”);. This function is generally on the handling of process control in part. PHP procedures include page read in the paper when it will come read it. In this way, can the process of implementation of the process simplified.
3, notes:
<? php
echo “This is the first example. \ n”; / / This example is the C + + syntax of the Notes
/ * This example of a multi-line
Notes way * /
echo “This is the second example. \ n”;
echo “This is the third example. \ n”; # in this case the use of UNIX Shell Grammar Notes
«>
4, variable type:
$ mystring = “I am a string”;
$ NewLine = “for the line \ n”;
$ int1 = 38;
$ float1 = 1.732;
$ float2 = 1.4E +2;
$ MyArray1 = array ( “son” and “ugly” and “yin” and “d”);
This leads to two questions, first of all PHP variables to $ beginning, the second sentence to PHP; at the end, may ASP programmers will not adapting. The two procedures are mostly left out of the wrong.
5, computing symbols:
Math:
Symbolic significance
+ Addition operator
– Subtraction operation
* Multiplication
/ Division operation
% From the balance
+ + Cumulative
– Decreasing

String operation:
There is only one operator symbols, English is the full stop. It will link up the string, a merger of the new string. Similar to the ASP &
< »
$ a = “PHP 4″;
$ b = “powerful”;
echo $ a. $ b;
«>
Here also raises two questions, first of all exports in the PHP language is the echo, the second in similar ASP <% = variable%>, PHP can also be < »= variable»>.
Logical:
Symbolic significance
<<
>>
<= Less than or equal to
> = Greater than or equal to
== Equivalent
! Not mean =
& & And (And)
and and (And)
| | Or (Or)
or or (Or)
xor vary or (Xor)
! Not (Not)
Here today, tomorrow, said the process control.

by pagecity.org : http://www.pagecity.org