I wrote for ten days to learn ASP I learned ASP.NET in ten days. Now I want to write PHP again. I won't mention PHP debugging methods here. Many articles have introduced PHP debugging methods, and there are many different combinations. I temporarily use Apache web server and MY SQL as the WEB The server and data base , in the environment of php 4.3.3. Of course, it is necessary to simply build and access the database PHPMYADMIN.
As for form design, I don't want to say much here.
Here is a brief introduction to PHP syntax.
1. Embedding method:
Similar to ASP's<%, PHP can be a? Php or<?, The ending symbol is?>, Of course, you can specify it yourself.
There are two ways to reference files: require and include.
The use method of require is as follows: require ("MyRequireFile. php"). This function is usually placed at the front of the PHP program. Before the PHP program executes, it will first read in the file specified by require to make it part of the PHP program web page. Common functions can also be introduced into web pages in this way.
Use methods of include, such as include ("MyIncludeFile. php"). This function is usually placed in the processing part of process control. The PHP program web page will read the include file when it reads it. In this way, the process of program execution can be simplified.
3. Annotation method:
- <? php
- echo "This is the first example. n" ;
- echo "This is the second example. n" ;
- echo "This is the third example. n" ; #This example uses UNIX shell syntax comments
4. Variable type:
- $mystring = "I am a string" ;
- $NewLine = "Wrapped n" ;
- $int1 = 38 ;
- $float1 = 1.732 ;
- $float2 = 1.4E+2 ;
- $MyArray1 = array ( Child , Ugly , Yin , "Mao" );
Two problems arise here. First, PHP variables begin with $, and second PHP statements begin with; At the end, ASP programmers may not adapt. These two omissions are also the source of most errors in the program.
5. Operation symbol:
Mathematical operation: symbolic meaning
There is only one operation symbol, that is, the English full stop. It can concatenate strings into new merged strings. Similar to that in ASP&
- $a = "PHP 4" ;
- $b = "Powerful" ;
- echo $a . $b ;
Two problems also arise here. First, the output statement in PHP is echo. Second, similar to<%=variable%>in ASP, PHP can also
<=less than or equal to
>=Greater than or equal to
!= Not equal to
Or or (Or)
That's all for today. Let's talk about process control tomorrow.