PHP Section Study notes

Source: Internet
Author: User

[Web development is divided into]
1. Static Web development (HTML page)
If one of our pages, is always static, then it is still web development, generally speaking with HTML technology OK
2. Dynamic Web Development
For example: We need to post, online payment, texting, e-mail .... This requires dynamic web development. Common Dynamic Web technologies PHP, JSP, Asp--àasp.net, CGI Universal Gateway Interface
c->c++->java->c#

[PHP Pros:]
① across platforms while supporting multiple databases
② safety and efficiency.
③ low cost of Use (Linux apache MySQL php kernel)
④ vs. JSP, and ASP.
⑤ Development Source (can do two times development)/open source software
⑥ better support for object-oriented in PhP4 PHP5 and upcoming releases PHP6
Disadvantages:
1. More complex installation, more configuration
2. Too flexible to interpret execution (compile execution), so some errors, until the real run time will be exposed


[b/S and C/s difference]
Advantages and Disadvantages:
Advantages of B/s:
1. Low development cost
2. Simple Management and maintenance
3. Product Upgrade Convenience
4. Low cost of training for users
5. Easy to use user, the probability of failure is small
b/S deficiency:
1. Insufficient security
2. Client can not change, subject to browser restrictions


[Port]
1. One machine can have port number 1-65535
2. In practical development, we often use
Netstat–an to see which ports on the machine are listening and if an abnormal port is detected, you can close the port
Netstat–anb
By changing the command we can find out which program is listening on that port and thus shutting it down.
3. One of the 80 ports is monitored by Apache, then the port can no longer be monitored by other applications.
(one port can only be monitored by one program)
4. The port is divided into the famous port 1-1024, other ports can be assigned by themselves

How Apache goes to configure ports
1. Our Apache software configuration is configured in the httpd.conf file, the file is in the Apache installation directory
Conf
In the httpd.conf file we modify the port:
Listen 81
Be sure to restart Apache when you are finished modifying

[Interview questions: and && both represent logic and, where are their differences?]
Mainly in the priority level above
Priority of and
and< = <&&
or < = < | |


[Three major process Control of PHP program]

① sequential control (top to bottom, left to right)
② Branch Control
A simple definition: there is a choice to execute our code.
Divided into 1. Single branch 2. Dual Branch 3 multi-branch
3. Cycle control

[Initial understanding of functions using function calls]
The knowledge points that PHP pages call each other
At present we have such a demand:
(1) a.php page to use the function defined by b.php, we can use the following instruction
Require require_once include include_once
Example of the use of require
<?php
Require (' filename to be introduced ');
$filePath = "abc.php"
Require $filePath;
Require ' file name (path) to be introduced '
?>

Case Description:
<?php
1.
Require ' b.php ';
2. By introducing variables
$fileName = "b.php";
Require $fileName;
3.
Require (' b.php ');
Here is the call function, how to understand the invocation of a function
ABC ();
Echo ' Hello III ';
?>

Definitions of PHP constants:
<?php

First Method (php4.0)
Define ("Tax_rate", 0.08);

Echo tax_rate;

Second method (php5.3)

Const tax_rate2=0.1;

Echo '-'. Tax_rate2;
?>

[function explanation]

PHP Section Study notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.