Array manipulation function 7!

Source: Internet
Author: User

Array_unique () rejects array duplicates, adds elements after generating a new array array--brackets [] after the array [] Array_unshift ()inserts an element at the head of an array, returning an int value Array_shift ()returns the deleted element, deleted from the head, or null if the deletion fails (if the first element is 0 o'clock, use the Is_null () function)Array_pop ()deletes an element from the bottom. unset ()Delete variable (number of known quantity group elements)Array_keys ()gets the key name of the array and returns the array formarray_values ()    gets the key value of the array and returns the array form

Each ()generates a new array of key-value key names for the array, 1,value returns the key value; 0,key returns the key namelist ()generates a variable for the value of the array (valid only for an indexed array)Array_map ()each element in an array is processed by a callback function. The return value is a new array of processed elementsArray_walk ()    each element in an array is processed by a callback function, returning a Boolean type (the argument is the opposite of the previous position)
Compact ()convert multiple variables to arrays with variable names as key names and variable values as key valuesExtract ()converts an array to a variable (the inverse of the previous function) for the indexed array element to generate a variable, parameter ($arr, Extr_prefix_all, ' parameter ') when called: "Parameter _ Key Name"                In_array ()determines whether an element exists in an array, if the argument is true, and the type is judged. Returns a Boolean type value
Array_merge ()The array merge function. array_merge_recursive ()merging multiple arrays, creating two-dimensional arrays if the key names are the same
: merge arrays with plus signs: Consider both the key and value pairs of the numeric indexes, and the key-value pairs of the string indexes, overwriting the values of the same key names with the values of the preceding array;

Merge the array with Array_merge (): Only consider the key-value pairs of the string index, overwrite the value of the previous array with the same key name, and the value of the numeric index is not overwritten while preserving

Also: Array_merge () will rearrange the number index of two arrays, "+" does not

Array_change_key_case () changing key name capitalization




From for notes (Wiz)

Array manipulation function 7!

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.