The code is not concise enough.
Copy codeThe Code is as follows: Function BubbleSort ($ str ){
For ($ I = 0; $ I For ($ k = count ($ str)-2; $ k >=$ I; $ k --) {// bubble this value forward;
If ($ str [$ k + 1] $ Tmp = $ str [$ k + 1];
$ Str [$ k + 1
Php forms are submitted and then rolled back. The content of the form is cleared by default (when session_start is used ),
The solution is to write it after session_start () and before the character output
Copy codeThe Code is as follows: header
In natural language, we understand the abstract concept that a large description of an object is a common feature for a certain type of object. The same is true in PHP. we abstract a class to specify the general behavior of the class. This class
First, a simple instance is provided.
Copy codeThe Code is as follows: If (! Is_dir ('txt ') // determines whether the txt file is a folder directory.
{
Mkdir ('txt '); // create a directory named txt
$ Open = fopen ('txt/in.txt ', "w +"); // open a
In the following cases, the variable is considered to beNULL:
AssignedNULL.
Not assigned.
Unset ().
NULLThe type has only one value, which is a case-insensitive keyword.NULL(You can write NULL or null ).
Converting a variable to the null type
Project Structure:
Add page: Note: only focus on operations, and there is no time for the interface artist. I hope you can understand it ......
List page:
Modify page:
SQL required in the project:
Copy codeThe Code is as follows: create database
Method 1:
Copy codeThe Code is as follows: /**
* Directory generation class: UtilsMakeDir
* @ Author yepeng
* @ Since 2010.3.18
*/
Class UtilsMakeDir {
// This directory is not created when the base directory is created. This should be an existing
I. File structure
Create 3 folders
The controller folder stores controller files.
View folder stores view files
Model folder stores data files
Create an index. php as the only entry
Ii. ControllerCreate a democontroller. php file in the controller
How does the encodeURIComponent function in JS decode Chinese characters using php ??
Prerequisites: The Chinese characters before encoding may be gbk, gb2312, UTF-8, and so on.
Copy codeThe Code is as follows: urldecode ()
Iconv
1. If a method c ++ an be static, declare it static. Speed improvement is by a factor of 4. If a method can be static, make a static Declaration on it. The speed can be increased to 4 times.
2. echo is faster than print. echo is faster than print.
3
Ob_flush/flush descriptions in the manual are used to refresh the output buffer and must be used together, which may lead to many confusion...
In fact, they have different operation objects. In some cases, flush does nothing at all ..
Ob _ * series
_ Autoload () is not used anymore. It has been mentioned in my WEB development notes before. PHP _ autoload function (automatically load class files) Use method, original address: http://www.jb51.net/article/29625.htm.
Let's talk about the usage of
However, this mechanism will always bring us this or that problem. For example, some time ago, when I set an advertisement display function on my site, I needed cookies, the main purpose is to increase the conversion rate of the advertisement.
In this case, your statistical system (which may be quantum or Baidu) cannot be used. However, we can use some anti-attack software, but the effect is sometimes not obvious. Next I will provide a piece of PHP code to prevent CC attacks.
Main
Knowledge point:
1. Introduction to JSON data formats
2. encode data in JSON format
3. decodes and operates JSON data.
The JSON data format is as follows:
Copy codeThe Code is as follows: {"programmers ":[
{"FirstName": "Brett", "lastName":
1. Write a PHP program named test. php. The content is as follows:
Copy codeThe Code is as follows: $ Fp = fopen ("test.txt", "a + ");
Fwrite ($ fp, date ("Y-m-d H: I: s"). "success! \ N ");
Fclose ($ fp );
?>
The program writes it boldly. It's
I. Analysis of conversion principle from Chinese characters to decimal characters
A Chinese Character in GBK encoding consists of two characters. The method for obtaining a Chinese character string is as follows:Copy codeThe Code is as follows: $
Generally, the display of website pages inevitably involves the interception of sub-strings. At this time, truncate is useful, but it is only suitable for English users. For Chinese users, if you use truncate, garbled characters may occur. In
There is a duration field in the test table of the mysql database, which contains three records:
00:22:32
13:42:21
134: 42: 21
It indicates the duration. However, the storage type is text.
Now, we need to use php to accumulate these records
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