Session_unset ()
Releases all the $ _ Session variables that have been created in the memory, but does not delete the session file or release the corresponding session
ID
Session_destroy ()Delete the session file corresponding to the current
At this time, the function bool session_set_save_handler (callback open, callback close, callback read, callback write, callback destroy, callback GC) is the solution to solve this problem.The function uses the following six functions:1. bool open ()
CopyCodeThe Code is as follows: Function array_add ($ A, $ B ){
// Obtain the intersection of two arrays based on the key name
$ Arr = array_intersect_key ($ A, $ B );
// Traverse the second array. If the key name does not exist with the first
CodeOptimization
Copy codeThe Code is as follows: for ($ I = 0; $ I Array_push ($ week, $ ARR );
}
Copy codeThe Code is as follows: for ($ I = 0; $ I $ Week [] = $ arr [$ I];}// This eliminates the extra burden of calling a function.
Benefits
The PHP framework can be a single entry, fully object-oriented, and fully class-based MVC mode. However, we face a lot of old
CodeOr even new Code does not fully conform to the object-oriented principle and the design pattern. Small applications.
Copy codeThe Code is as follows: /**
* Factory method mode
*
* Defines an interface for creating objects so that the subclass decides which class to instantiate and delays the instantiation of a class to its subclass.
*/
/*Class DBFactory{Public
Because of its own defects, the inheritance relationship has been detained by experts as "evil. Experts such as "using delegate relationships instead of inheritance relationships" and "Using Interfaces as much as possible instead of abstract class
Copy codeThe Code is as follows: /**
* Bridging Mode
*
* Separate the abstract part from its implementation part, and use them to have independent changes
*/
Abstract class Implementor
{
Abstract public function operation ();
}
Class
Copy codeThe Code is as follows: /**
* Combination Mode
*
* The object is combined into a tree structure to represent the "part-whole" hierarchy, so that the customer's use of a single object and composite object is consistent.
*/
Abstract class
URL jump code
1. Code:
For example, if you save it as aaa. php, You can implement aaa. php? Url = www.baidu.com jump to Baidu.
This simple call of the default $ _ GET variable. and php default jump Location:
2. instance upgrade: add if
Copy codeThe Code is as follows :#! /Usr/local/bin/php-q
Author: freemouse
// The description is as follows.
Print ("this program is used to merge two. \ n records of 640xxsize ");
Print ("image, and convert it to a 400x300 image \ n ");
Print
Install IIS 7.0
OpenControl Panel \ Programs and Features \ Turn Windows features on or offIn the displayed dialog box, select the following two options:
Click OK. Wait for a moment and IIS installation is complete.
Install PHP 5.2.6
1.
Example 1 (POST submission form ):
Copy codeThe Code is as follows:
Chunkify Form
Enter a word:
How long shocould be the chunks be?
Copy codeThe Code is as follows:
Chunkify Word
$ Word = $ _ POST ['word'];
$ Number = $ _ POST
// Form upload can only use the multipart/form-data encoding format
$ _ FILES system functions;
$ _ FILES ['myfile'] ['name'] File name
$ _ FILES ['myfile'] ['type'] specifies the file type, which is restricted by the server.
Image
# JS call function to pass variable parameters
Copy codeThe Code is as follows:
# PHP call the function to pass variable parametersCopy codeThe Code is as follows: // Method 1// Receives a series of parameters and outputs them one by oneFunction
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