Php users use the standard time of Lin Weizhi, so it is related to Beijing time for 8 hours. Many friends will find a time difference of 8 hours when using php date and time to get the time difference, next let's look at the solution.
The simplest
You can obtain and subtract the start time and end time of the page through the commonly used microtime (). The calculation result is a period of time that the page has been running, however, this is not necessarily the time when the page is running.
When the require function is used in php to load the utf8 file, an empty line is generated because several UTF-8 characters are generated during file editing in windows, these characters are called Unicode signatures (BOM ).
The use of require is
Constructor and destructor in php are both used in classes. Next I will introduce in detail the methods for using constructor and destructor in php classes, for more information, see.
Destructor
The role of php destructor is just opposite to that of
This article introduces how to obtain the ID value of the inserted data in php. php provides the mysql_insert_id () function. We only need to add echo mysql_insert_id () after inserting data.
Example
The Code is as follows:
Copy code
This article introduces the singleton mode of php design mode instances. For more information, see reference.
Singleton class:
1. the constructor must be marked as private. The Singleton class cannot be instantiated in other classes and can only be
I believe many new php users, like me, have been depressed when learning PHP. @ (At) What is the mark?
Once you download other people's source code, you can see countless @ marks and start to think it is a comment. Later, you will find that the @
In php, array definition has several methods, such as array () or arr [], to implement array definition. Next I will give you a detailed explanation of various techniques for defining php arrays.
PHP array is an important concept. It contains a
In php, the process control statements include the while, for, if, switch, foreach, and declare statements. The following describes how to use the process control statements, I hope this method will be rent out to all of you.
In PHP, a flow control
There are several reasons for Chinese garbled characters on PHP pages. One is that the page encoding is not counted. The other is that no encoding is set in the database. The third is that there is a problem with apache encoding, the following two
At school, our teacher told us that there will be many algorithms for program data sorting. In fact, the bubble algorithm is a commonly used sorting algorithm. Next I will use php to Implement Bubble sorting, and record it below.
Example 1
There are many ways to filter out special or invalid characters in php, such as the regular expression str_replace, which is a good method, such as carriage return, space, line breaks can be solved with it.
A nearly responsible system module is
In php, The foreach statement is used to traverse the array cyclically. The value of the current array element is assigned to the value variable (the array pointer moves down one by one)
Example
The Code is as follows:
Copy code
Unlimited classification is a problem encountered in all program development. Next I will introduce an infinitely classified program implemented by php + mysql. If you need it, please refer to it.
Let's take a look at my database structure. The
This article provides a php image processing class for free: scaling down, cropping, rounded corners, and skewed code. He can cut out pictures of different styles. Haha, it is much better than other online cut pictures.
Php tutorial image processing
This article provides a php course Chinese Character Verification Code Generation Program. If you want to generate Chinese Characters in an image, you need the font file and the imagettftext function. If you want to use it, search for it online. If
The gd library is a specialized library for processing images in the php tutorial. It can process most data conveniently and quickly. It provides a large number of image processing functions, the following uses the function of the gd library to
This article introduces the usage of parse_url () function in php. If you need parse_url () function, refer to this article.
A useful function in PHP, parse_url, is particularly convenient for information capture analysis. For example:
The
PHP is a loose language and does not need to define the variables used. This makes programming flexible and convenient. However, during programming, we need to know which type of variables we use, because there is always a corresponding type of
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