does not contain duplicate values
$result = Array_unique ($nums);
Print_r ($result);
?>
Output
Array ([0] = 1 [1] = 2 [2] = 3 [3] = 4 [4] = 5 [5] = 6)
9. Array_flip ()--swap keys and values in an array
$userages = Array (' Jack ' = +, ' Lucy ' =>25, ' Mark ' =>28);
$ages = Array_flip ($userages);
Print_r ($ages);
?>
Output
Array ([+] = Jack [+] = Lucy [+] = Mark)
Three Array in array
The array is not necessarily a list of keywords and values, and arrays can also be placed in
[1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6)9. array_flip () -- exchange keys and values in the array
$ Userages = array ('Jack' => 23, 'Lucy '=> 25, 'mark' => 28 );$ Ages = array_flip ($ userages );Print_r ($ ages );?>
Output
Array ([23] => Jack [25] => Lucy [28] => Mark)
3. array in the array
An array is not necessarily a list of keywords and values. an array can also be placed in an array.
The code is as follows:
$ Produces = array (Array ('apple', 6, 28.8 ),Array ('pear ', 3, 15.6 )
:
$ Fruits = array ("apple", "banana", "pear ");$ Numbered = array ("1", "2", "3 ");$ Cards = array_merge ($ fruits, $ numbered );Print_r ($ cards );// Output// Array ([0] => apple [1] => banana [2] => pear [3] => 1 [4] => 2 [5] => 3)?>
2. append an array
The array_merge_recursive () function is the same as the array_merge () function. two or more numbers can be combined to form a combined array. the
This article mainly introduces some built-in php functions for operating arrays.
1. Merge arrays
The array_merge () function combines arrays and returns a Union array. The obtained array starts with the first input array parameter and is immediately added according to the order in which the following array parameters appear. The format is:
Copy codeThe code is as follows:
Array array_merge (array array1 array2 ..., ArrayN)
This function combines the units of one or more arrays. the values of
1. Merge Arrays
The array_merge () function combines arrays and returns a union array. The obtained array starts with the first input array parameter and is immediately added according to the order in which the following array parameters appear. The format is:
Copy codeThe Code is as follows: array array_merge (array array1 array2 ..., ArrayN)
This function combines the units of one or more arrays. The values of an array are appended to the values of the previous array. Returns an array of resu
1. Merging Arrays
The Array_merge () function merges the arrays together, returning a federated array. The resulting array begins with the first input array parameter and is forced in the order in which the following array parameters appear. In the form of:
Copy Code code as follows:
Array Array_merge (array array1 array2...,arrayn)
This function merges the cells of one or more arrays, and the values in one array are appended to the previous array. Returns an array as th
1. Merging Arrays
The Array_merge () function merges the arrays together to return an array of unions. The resulting array starts with the first input array parameter, forcing it sequentially in the order in which the array parameters appear later. The form is:
Copy CodeThe code is as follows:
Array Array_merge (array array1 array2...,arrayn)
This function merges the cells of one or more arrays, and the values in an array are appended to the previous array. Returns an array as the result.
If
Php operation array (merge, split, append, search, delete, etc.) 1. Merge the array
The array_merge () function combines arrays and returns a Union array. The obtained array starts with the first input array parameter and is immediately added according to the order in which the following array parameters appear. The format is:
The code is as follows:
Array array_merge (array array1 array2 ..., ArrayN)
This function combines the units of one or more arrays. the values of an array are appended to
1. Merging arrays
The Array_merge () function merges the arrays together to return an array of unions. The resulting array starts with the first input array parameter, forcing it sequentially in the order in which the array parameters appear later. The form is:
Copy the code code as follows:
Array Array_merge (array array1 array2...,arrayn)
This function merges the cells of one or more arrays, and the values in an array are appended to the previous array. Returns an array as the result.
If the
This article mainly introduces some built-in php functions for operating arrays.
1. Merge arrays
The array_merge () function combines arrays and returns a Union array. The obtained array starts with the first input array parameter and is immediately added according to the order in which the following array parameters appear. The format is:
The code is as follows:
Array array_merge (array array1 array2 ..., ArrayN)
This function combines the units of one or more arrays. the values of an arra
1. Merging arrays
The Array_merge () function merges the arrays together to return an array of unions. The resulting array starts with the first input array parameter, forcing it sequentially in the order in which the array parameters appear later. The form is:
Array Array_merge (array array1 array2...,arrayn)
This function merges the cells of one or more arrays, and the values in an array are appended to the previous array. Returns an array as the result.
If the input array h
1. Merge Arrays The array_merge () function combines arrays and returns a union array. The obtained array starts with the first input array parameter and is immediately added according to the order in which the following array parameters appear. The format is:Copy codeThe Code is as follows:Array array_merge (array array1 array2 ..., ArrayN) This function combines the units of one or more arrays. The values of an array are appended to the values of the previous array. Returns an array of results
rapid-disease-jealous-level squeezing several ridges of thistle-ji-throb-in-the-season-ritual-and-death-and-death-and-death------to-be-Jicha-ji-ji-Jia plus pod-buccal fieldoptical potassium fake price rack drive to marry the fighter to fight the hard to fry and shoulder the difficult to rape sealed cocoon inspection Cambodian alkali pick pick Jiang shear Reduction recommended sill practice base See key arrow Jian preserves gradually splash Jian Jian Jiang Jiang will pulp River Chiang Paddle Awa
jealous level squeeze several ridges of Thistle, the season of the festival. Throb Ji sent the silence count not only taboo inter-prostitute Jicha the house add pod cheek fieldoptical K false Price frame drive marry fighter Jian pointed to fry and shoulder difficult rape sealed cocoon inspection Cambodian alkali pick pick Jiang shear reduction recommended sill practice cheap See key arrow Pieces Jian-ship Jian preserves gradually splash Jian Jiang will be the pulp River Jiang Xinjiang Propeller
] => banana [2] => pear [3] => 1 [4] => 2 [5] => 3 ) ?>
2. append an array
The array_merge_recursive () function is the same as the array_merge () function. two or more numbers can be combined to form a combined array. the difference between the two is that when a key in an input array already exists in the result array, the function will adopt different processing methods. array_merge () overwrites the existing key/value pairs and replaces them
overwrite the original values, but will be appended to the back.
If only one array is assigned and the array is indexed by number, the key name is re-indexed continuously.
apple [1] => banana [2] => pear [3] => 1 [4] => 2 [5] => 3 )?>
?
?2. append an array
The array_merge_recursive () function is the same as the array_merge () function. two or more numbers can be combined to form a combined array. the difference between the two is that when a key
, help users find the list they want to buy faster and better. This concept, or the target, looks rather virtual, and we need to transform it into a technical goal that is easy to measure and implement. The final technical goal is to click on a single rate estimate to predict the probability of a user clicking or buying a purchase order. We will predict the click or the next single-rate high list in front, the more accurate the prediction, the user in the order of the list click, the more the or
) {Console.log ( This. Name + "This year" + This. Age, "eat" + like + "Don't like to eat" +dislike)} } varA = {name: "Jay", age:23} obj.fun.call (A,"Apple", "banana")//Jay this year 23 likes eating apples do not like to eat bananasobj.fun.apply (a,["Apple", "banana") //Jay this year 23 likes eating apples does not like eating bananasObj.fun.bind (A, "apple", "banana
PHP Operations Array (merge, Split, append, find, delete, etc.)
Blog Categories:Php/pear/mysql/node.js
1. Merging arrays
The Array_merge () function merges the arrays together, returning a federated array. The resulting array begins with the first input array parameter and is forced in the order in which the following array parameters appear. In the form of:
Array Array_merge (array array1 array2...,arrayn)
This function merges the cells of one or more arrays, and the values in one ar
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.