PHP Lesson 1: a simple understanding of PHP. PHP Lesson 1: a simple understanding of PHP goal planning: through the first lesson, we can understand the php environment. 1. environment Awareness: 2. access Method: 3. modify the code and view it. 4. use of variables 5. code indent PHP lesson 1 brief introduction to PHP
Target planning:
Through the first lesson, we can understand the php environment.
1. environment awareness:
2. access method:
3. modify and view the code.
4. use of variables
5. code indentation must have a hierarchical relationship, and it is best to keep blank lines between codes.
6. variable naming:
7. output of variables:
8. three methods of variables:
1. environment awareness:
Software: http://download.csdn.net/detail/junzaivip/7697331
The installation tutorial is very simple. you can click here on your own
Directory structure after installation:
<喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4KPHA + signature + 1rG909Ta5K/Signature/ybfDzso8L3A + signature/tC48L3A + CjxwPs7Sw8e/signature + sLro7o8L3A + signature = "brush: java;">
";echo "Hello world";echo "/html";?>
Recommended syntax
4. use of variables
5. code indentation must have a hierarchical relationship, and it is best to keep blank lines between codes.
6. variable naming:
. Try not to use Chinese characters
. Try not to start with a number
. Try not to use meaningless letters
. Variable names are case-sensitive. function names are case-insensitive and class names cannot be case-sensitive.
6. 5. the variable definition must be added with $
7. output of variables:
Echo $ name;
8. three methods of variables:
Echo ($ name); // output variable
Var_dump ($ name); // output array, and print type and length
Print_r ($ name); // output array
Example:
Shown below
Through the above display, we can see that the display is very unattractive and does not need to be read, so the formatting output scheme is as follows:
"; Print_r ($ arr); echo"
";?>
The result is as follows:
Tips:
Utf-8 encoding, a Chinese character is 3 characters
Gbk encoding, a Chinese character is 2 characters
Tips: Let's get to know the PHP environment through the first lesson. 1. environment Awareness: 2. access Method: 3. modify the code and view it. 4. use of variables 5. code indent...