1. You can directly use the PHP built-in function array_intersect () Array array_intersect (array $ array1, array $ array2 [, array $...])
Array_intersect () returns an array containing all values that appear in the array of all other parameters at
Configuration:
1. Download vc9 x86 thread safe from the windows.php.net/download website
2. decompress the file to the directory.
3. Modify PHP. ini (delete PHP. ini_d...) and open the MySQL extension (Delete; Extension = php_mysql.dll)
The number_format () function uses a thousand-bit grouping to format numbers.
Syntax Number_format (number, decimals, decimalpoint, separator)
Parameters
Description
Number
Required. The number to be
Copy codeThe Code is as follows: $ a = array (1, 2 );
$ B = array (11, 12 );
Foreach ($ a as & $ r ){
}
Foreach ($ B as $ r ){
}
Echo $ a [1]; // OUTPUT 12
The intention of the two loops may be: the first loop needs to modify the element
1. When a user accesses the SERVER, use the PHP super global variable $ _ SERVER array field ['HTTP _ USER_AGENT '] To obtain all information of the user
$ _ SERVER ['HTTP _ USER_AGENT '] string during my access:
Mozilla/5.0 (Windows; U; Windows NT 6
Copy codeThe Code is as follows: /*
* Created on 2010-10-27
* BY QQ542900563
* Copyrights Reserved 2000-2020
* This example shows how to generate an image watermark.
*/
// Load two images respectively
$ Im = imagecreatefromjpeg ("liu.jpg ");
Copy codeThe Code is as follows: // The session set on the login page. When the session contains the name
// Session_start ();
// $ Name = $ _ SESSION ['name'];
// If (empty ($ name )){
// Header ("Location: error. php ");
// Exit ();
//}
// Process-
The following is a code written in php to obtain crawling records of search spider.
The following search engines are supported:
Record the crawling websites of Baidu, Google, Bing, Yahoo, Soso, Sogou, and Yodao!
The php code is as follows:
Copy
1. Usage of ++ I (using a = ++ I, I = 2 as an example)
Add the I value to 1 (that is, I = I + 1) and then assign it to variable a (that is, a = I ),
The final a value is 3, and the I value is 3.
So a = ++ I is equivalent to I = I + 1, a = I
2.
/**
* $ SplitChar field delimiter
* $ File data file name
* $ Table database table name
* $ Conn database connection
* $ Name of the column corresponding to fields data
* $ InsertType INSERT operation type, including INSERT and REPLACE
*/
Copy
I. array processing functions:
Intoxicating: array processing functions are very common in PHP development. Learning array processing functions is crucial. array Processing functions involve the creation of arrays, the conversion of strings from
Reg. php
Copy codeThe Code is as follows:
registration page
Error_reporting (0 );
// Prevent PHP reports from being reported. If it is not closed, the following error occurs: Warning: preg_match ().
Session_start ();
Header
Recently, when reading a cool man's code, I saw a very useful function: extract (). Its main function is to expand the array and use the key name as the variable name, the element value is a variable value, which provides another convenient tool for
1. code optimization
Code optimization not only writes clean and clear code, but also simplifies the code. Zend Optimizer can be used to automatically complete these complex tasks. Zend Optimizer can be obtained from Zend Technologies's website http:
First, we need jquery. js, jquery. autocomplete. js, and jquery. autocomplete. js. Where are these three files? Baidu and Google can all be found. You can go to the official website to go up and down, which contains some demos and leave only these
I am often asked if the PHP array is accessed using foreach, is the traversal order fixed? In what order does it traverse?
For example:
Copy codeThe Code is as follows: $ Arr ['laruence '] = 'huixinchen ';
$ Arr ['yahoo '] = 2007;
$ Arr ['baidu'] = 2
When searching for something, we often encounter the goal of inputting multiple conditions through spaces. Today, I encountered this problem in the project. I wrote a function and put multiple conditions in the array. Currently, space, comma
When $ _ post [''] and $ _ get [''] are used to obtain parameters in the formNotice: Undefined index :--------;
We often receive Undefined index errors when receiving data from form POST, as follows: $ act =$ _ POST ['action'];The above code always
I. Modify the File Upload language to PHP.Open fckconfig. js
Find:
Var _ FileBrowserLanguage = 'asp'
Var _ QuickUploadLanguage = 'asp'
Changed:
Var _ FileBrowserLanguage = 'php'
Var _ QuickUploadLanguage = 'php'
Ii. Enable PHP File Upload1: Enable
Use the array_multisort () function to sort multiple arrays or multi-dimensional arrays. If you are studying array sorting and multi-dimensional array sorting, you can see.
Function bool array_multisort (array & $ arr [, mixed $ arg = SORT_ASC [,
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