The most commonly used data structure in PHP is arrays, which can help us solve a large part of the programming problem. In fact, there are a lot of array operations without our own writing, the system has come with the relevant functions. Let's describe some of the functions of the PHP array operation, perhaps some of which you have not heard of.
- Searches for a specific value in the array and returns TRUE if found returns false
Boolean In_array (mixed Needle,array Haystack[,boolean Strict])
- Finds a specified health in the array, returns true if found or false
Boolean array_eky_exists (mixed Key,array array)
- Searches for a specific value in the array and returns TRUE if found returns false
Boolean array_search (mixed Needle,array Haystack[,boolean Strict])
- Gets a new array of all the key elements of the array
Array Array_keys (array array[,mixed search_value])
- Gets a new array of all the values in the array
Array array_values (array array)
- Determining the size of an array
Integer count (array array[,int mode]) integer sizeof (array array[,int mode])
- Statistical array element Occurrence frequency
Array array_count_values (array array)
- Removes duplicate values from an array, returning an array of unique values
Array array_unique (array array)
- Inverse array element order, Preserve_key If true, the array key value order is unchanged
Array array_reverse (array Array[,boolean Preserve_key])
- Permutation array keys and values
Array array_flip (array array)
- Array order ordering, sort_flags parameter optional, default behavior
Sort_numberic, sorted by numeric value, is useful for sorting integers or floating-point numbers sort_regular, sorting sort_string by ASCII values, sorting asort functions in the correct order of the people's knowledge, the order of the key values is not changed void sort (array Array[,int sort_flags]) void Asort (array array[,int sort_flags])
- Array in reverse order, sort_flags parameter optional, default behavior
Sort_numberic, sorted by numeric value, is useful for sorting integers or floating-point numbers sort_regular, sorting sort_string by ASCII values, sorting arsort function key values in the right order of access to People's knowledge (array Array[,int sort_flags]) void Arsort (array array[,int sort_flags])
- Array Natural Sorting
void Natsort (array array)
- Case-insensitive natural sorting
void Natcasesort (array array)
- To sort the key values in an array
Boolean ksort (array array[,int sort_flags])
- Order of the key values in the reverse sequence
Boolean krsort (array array[,int sort_flags])
- Sort by user-defined order
void Usort (array array,callback function_name)
- Merges the arrays together to return an array of unions. Array_merge is covered in front, Array_merge_recursive merged together
Array Array_merge (array Array1[array array2 ...]) More than one array array_merge_recursive (array Array1,array array2[,array ...]) More than two
- Keys and values make up a new array
Array array_combine (array Key,array value)
- Returns the part of an array, starting with the offset, to the end of the offse+length position
Array array_slice (array array, int offset [, int length])
- Removes all elements from offset start to end of Offset+length and returns the deleted element as an array
Array Array_splice (array, int offset [, int length[,array peplacement]])
- To find the intersection of the array, the key value is the first array of key values
Array array_intersect (array Array1,array array2[,arrayn ...])
- The intersection of the array contains the key values equal to the key values in the first array
Array Array_intersect_assoc (array Array1,array array2[,arrayn ...])
- To find the difference set of the array, the first array has no value in the other array
Array Array_diff (array Array1,array array2[,arrayn ...])
- To find the difference set of the array, the first array in the other array does not have values that contain the key values equal
Array Array_diffassoc (array Array1,array array2[,arrayn ...])
- Returns one or more key values in an array
Mixed Array_rand (array array[,int num_entries])
- Shuffle function immediately
void Shuffle (array input_array)
- Sum the values in an array
Mixed array_sum (array array);
- Decomposes an array into a multidimensional array that contains a size element
Array array_chunk (array array, int size [, Boolean Preserve_keys])
http://www.bkjia.com/PHPjc/752578.html www.bkjia.com true http://www.bkjia.com/PHPjc/752578.html techarticle The most commonly used data structure in PHP is arrays, which can help us solve a large part of the programming problem. In fact, there are a lot of array operation without our own writing, the system has come from the phase ...