PHP Array correlation function Summary, PHP array function _php Tutorial

Source: Internet
Author: User

PHP Array correlation function Summary, PHP array function


This article summarizes the functions associated with PHP arrays. Share to everyone for your reference. Specific as follows:

This includes the function name and usage instructions, with no detailed code examples. Interested friends can consult the relevant functions of the site usage.

Related processing functions for arrays

Current (array name) outputs the value of a string in the array, starting with the first one.
Key (array name) an subscript from the output array, starting from the first one.
Next (array name) controls the array pointer to move backwards.
Prev (array name) controls the array pointer to move forward.
End (array name) controls the array pointer moves to the last one.
Reset (array name) controls the array pointer to the first bit.
Array_change_key_case (1. Target array 2.case_upper uppercase or Case_lower lowercase) changes the array subscript all to uppercase or lowercase.
Array_chunk (1. Target array 2. Number of decomposition 3. Output Boolean true or false) breaks an array into multiple decimal groups.
The Array_count_values (array name) is used to calculate the number of occurrences of each value in the array.
Array_fill (1. Subscript starting from several 2. How many 3. What are their values) used to initialize the array.
Array_filter (1. Target array 2. The user-defined function) filters the function, customizing what criteria to be true, and by what criteria is false, this function can automatically filter out false strings.
Array_flip (target array) the subscript variable value, the value of the subscript.
Array_sum (destination array) calculates the sum of all the element values in the destination array.
Array_unique (target array) removes duplicate values from the target array.
Array_values (target array) removes all subscripts from the target array, starting with "0" to calculate the subscript of the value in this function.
Array_keys (destination array) outputs all subscripts in the destination array.
In_array (1. What to look for 2. Target array 3. Whether to search strictly by data type, is to lose true) look for data in the target array that has no lookup.
Array_search (1. What to look for 2. Target array 3. Whether or not to find the target array with no lookup data, and then output the subscript for this data.
Array_key_exists (1. Subscript 2. Target array) Find the subscript in the target array with no lookup, then output true, and false for none.
Extract (target array) converts an array into a variable.
Compact (the variable subscript to convert an array) converts multiple variables into an array.

Arrays and stacks (advanced back-out)

Array_push (1. Target array 2. The value of the push-in stack) is pressed into the stack function.
Array_pop (target array) popup stack function.

Array and Team (FIFO)

Array_unshift (1. Target array 2. The value of the press-in pair) presses into the pair function.
Array_shift (1 target array) pops up on the function.

Array ordering for ignoring key names:

Sort (target array) from small to large.
Rsort (target array) from the large to the small sort.
Sort an array of reserved key names:
Asort (target array) retains the original subscript, and the values are sorted from small to large.
Arsort (target array) retains the original subscript, and the values are sorted from large to small.

Sort by natural sort:

The Natsort (target array) retains the original subscript, with a value from a large to a small sort, not case sensitive.
The Natcasesort (target array) retains the original subscript, and the values are sorted from small to large, not case-sensitive.
Array_merge (1. Target array 2. Target array ...) merges multiple arrays.
Array_diff (1. Be compared to array 2. than array 3. than array ...) to find the difference of the array.
Array_intersect (1. is compared to array 2. than array 3. than array ...) to find the cross-product of the array.

I hope this article is helpful to everyone's PHP programming.

http://www.bkjia.com/PHPjc/972635.html www.bkjia.com true http://www.bkjia.com/PHPjc/972635.html techarticle PHP array- related functions summary, PHP array functions This article summarizes the PHP array-related functions. Share to everyone for your reference. Here are the following: This includes the name of the function and the description of usage, no ...

  • 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.