CopyCodeThe Code is as follows: // database/table sharding
Algorithm
Function calc_hash_db ($ U, $ S = 4)
{
$ H = sprintf ("% u", CRC32 ($ u ));
$ H1 = intval (fmod ($ H, $ s ));
Return $ H1;
}
For ($ I = 1; I I {Echo calc_hash_db ($ I
1. Simple Object Creation
CopyCode The Code is as follows: // The scope of the class final: will prevent the subclass from overwriting this field
// The scope of the method Abstract: declared in the parent class, implemented in the subclass
//
1. When passing an array in a function
Using return is more efficient than using global
For example
Function userloginfo ($ usertemp ){$ Detail = explode ("|", $ usertemp );Return $ detail;}$ Login = userloginfo ($ userdb );RatioFunction
CopyCode The Code is as follows:
Page 1
Copy code The Code is as follows: Include ("include/DB. Inc ");
$ Ws = $ _ Get ['worksheet '];
If (empty ($ ws) | strlen ($ ws) // Echo 'oo ';
Exit ();
}
$ Db = new dB ();
$ STR = '';
$ SQL = "select *
The following is my development process.
First, my tinymce version is version: 3.2.7 ).
Http://www.jb51.net/codes/17198.html
Tinymce insert
Code , You need to call tinymce.exe ccommand ('mceinsertcontent', false, value); method of tinymce. The
CopyCode The Code is as follows: /*
* Class: MSSQL
* Time: 2009-12-10
* Author: libaochang
* Version: 1.0b
* Description: MSSQL database access class, it can execute the procedur or SQL
*/
Class mssqlutil
{
VaR $ user = NULL; // Database User
As the hardware configuration of devices continues to improve
Program For example
Algorithm The requirements for space complexity are also quite relaxed. However, in today's web era, the time complexity of applications has higher requirements.
In web development, we often cache time-consuming operations on our databases, but there may be a trap. When the cache becomes invalid, a large number of accesses will be marked as invalid cache, all go to the backend to query the database,
For a large message queue, it is too costly to frequently serialize and deserialize large databases. The following is a message queue that I implemented using PHP. I only need to insert a data at the end of the queue to operate the end, without
PHP only includes class, method, attributes, and extensions. It is not used to development in object-oriented languages such as C ++, Java, and Delphi.
Program Users may wish to read a book on object oriented concepts first. I believe this will
Merging arrays has three functions:
1. array_combine ()
It carries two parameter arrays. The value of parameter array 1 serves as the key of the new array, and the value of parameter array 2 serves as the value of the new array. Very simple.
Merge PHP computing hours to zero
CopyCode The Code is as follows:/* Author: Yang Yu yangyu@sina.cn */
// The $ hours_min parameter is an array. The array format is and the return value is 1 hour.
/*
For example:
$ Hours_min [0] = '1: 10 ';
$ Hours_
In this section, we will look at how to create a class and object in PHP.
1. Create a class
In PHP, the creation of a class is basically similar to that in C #/Java. Let's take a look at the simplest example:CopyCodeThe Code is as follows:
The output control function does not affect the header information sent when header () or setcookie () is used. It only applies
Code .
Let's take a simple example to give you a general impression on Output Control:Example 1.PHP codeCopy codeThe
The principle is as follows:
Encryption
Plaintext: 1010 1001
Key: 1110 0011
Ciphertext: 0100 1010
The ciphertext 0100 1010 is obtained, and the decryption must be different from the key or lower.
Decryption
Ciphertext: 0100 1010
Key: 1110
To implement gzip compression pages, the browser and the server need to support them. In fact, the server is compressed. After being uploaded to the browser, the browser decompress and parse the files. We don't need to worry about browsers, because
First look
File interface before creation
After the configuration file is created, the system prompts that the installation cannot be repeated.
NextCodeRight, the code on the HTML interface will not be available. Just go to the PHP
What is a magic function?
For functions starting with _, they are named Magic functions. These functions are triggered under specific conditions, such as _ set () _ get ().
Triggered when setting or retrieving nonexistent attributes.
What about the
I have heard that this method violates some search engine operating principles and may be penalized by various search engines or even deleted from websites. so I have just removed this process until I confirm that it is not cheating. if you have the
1. Message Display page
2. Publish messages and allow uploading images
3. Enter the password to log on and delete the message.
1. File directory
Upfile is the directory for storing uploaded images.
2. Main Interface
(1) homepage: displays the
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