Ten Days Learn the first day of PHP

xiaoxiao2021-03-06  38

Let's take a brief introduction to the grammar of PHP.

1, embedding method:

Similar to ASP <%, PHP can be , Of course you can specify yourself.

2, reference file:

There are two ways to reference files: Require and Include. The method of use of Requires such as Require ("MyRequirefile.php"); This function is usually placed in the forefront of the PHP program, and the PHP program will read the files introduced by Require before execution, so that it becomes a part of the PHP program page. Commonly used functions, or this method can introduce it into a web page. Include use method such as include ("Myincludefile.php"); This function is typically placed in the processing section of the process control. The PHP program page reads in when reading the file. This way, the process can be simplified when the program is executed.

3, annotation method:

4, variable type:

$ mystring = "I am string"; $ newline = "wrap / n"; $ INT1 = 38; $ float1 = 1.732; $ float2 = 1.4e 2; $ myArray1 = array ("子", "ugly" , "", "");

Here, two problems, first, PHP variables are starting, the second PHP statement; the end, maybe ASP programmer will not be adapted. These two omissions are also most errors in the program.

5, operation symbol:

Mathematical operation: symbolic meaning addition operation - subtraction operation * Multiplication / division operation% Take the amount accumulation - decrement

String operation:

The operation symbol is only one, that is, the English number. It can connect a string to a merged string. Similar to ASP & <$ a = "PHP 4"; $ b = "powerful"; Echo $ a. $ B;?> Here is two problems, first of all PHP output statements are echo, second similar <% = Variable%>, PHP can also be .

Logic operation: symbolic meaning greater than <= less than or equal to> = greater than or equal to == equal to! = Not equal to && and (AND) AND (AND) || or (or) or (or) xor (Xor)! No (not)

Today, I said this, I said the process control tomorrow.

转载请注明原文地址:https://www.9cbs.com/read-57590.html

New Post(0)