PHP Array Function Summary, php array function _ PHP Tutorial

Source: Internet
Author: User
PHP array functions. PHP array functions. This article summarizes php array functions. Share it with you for your reference. The details are as follows: function names and usage descriptions are included here. no summary of PHP array functions is available, and php array functions are available.

This article summarizes functions related to PHP arrays. Share it with you for your reference. The details are as follows:

The function name and usage are described here. no detailed code examples are provided. If you are interested, you can refer to the function usage related to this site.

Array-related processing functions

Current (array name) outputs the value of a string in the array, starting from the first.
Key (array name) outputs a subscript in the array, starting from the first.
Next (array name) controls the backward movement of the array pointer.
The prev (array name) controls the forward movement of the array pointer.
The end (array name) controls the movement of the array pointer to the last one.
The reset (array name) controls the migration of the array pointer to the first place.
Array_change_key_case (1. target array 2. CASE_UPPER upper case or CASE_LOWER lower case) change all array subscript to upper case or lower case.
Array_chunk (1. target array 2. number of decomposition 3. true or false boolean values are output). an array is decomposed into multiple small arrays.
Array_count_values (array name) is used to calculate the number of occurrences of each value in the array.
Array_fill (1. the subscript starts from a few. 2. how many are Output. 3. what are their values?) is used to initialize the array.
Array_filter (1. target array 2. user-defined functions) filter functions. this function automatically filters out false strings based on the criteria that are true and false.
Array_flip (target array) changes the subscript value and the value to the subscript.
Array_sum (target array) calculates the sum of all element values in the target array.
Array_unique (target array) removes repeated values from the target array.
Array_values removes all the labels in the target array and recalculates the subscript of the value in this function from "0.
Array_keys (target array) outputs all subscript in the target array.
In_array (1. what you are looking for 2. target array 3. Whether to strictly search by data type, if yes, enter true) to search for any searched data in the target array.
Array_search (1. what you want to find 2. target array 3. Whether to strictly search) to find the target array with no searched data. If yes, the subscript of this data is output.
Array_key_exists (1. subscript to be searched 2. target array) to find whether there is any subscript in the target array. If yes, true is output and false is output.
Extract (target array) converts an array to a variable.
Compact (variable subscript to be converted to an array) converts multiple variables into an array.

Array and stack (advanced and later)

Array_push (1. target array 2. value of pushing stack) the function of pushing stack.
Array_pop (target array) pops up the stack function.

Arrays and queues (first-in-first-out)

Array_unshift (1. the target array 2. the value of the push-in pair.
The array_shift (1 target array) function is displayed.

Ignore the array sorting of key names:

Sort (target array) is sorted from small to large.
Rsort (destination array) is sorted from large to small.
Sort the array with the reserved key name:
Asort (target array) retains the original subscript and sorts the values from small to large.
Arsort (target array) retains the original subscript and sorts the values from large to small.

Sort by natural sorting:

Natsort (target array) retains the original subscript and sorts the values from large to small, case insensitive.
Natcasesort (target array) retains the original subscript and sorts the values from small to large, case insensitive.
Array_merge (1. target array 2. target array...) merge multiple arrays.
Array_diff (1. get the difference product of array than array 2. 3. get the difference product of array than array.
Array_intersect (1. compared with array 2. compared with array 3. compared with array...), calculate the intersection of array.

I hope this article will help you with php programming.

This article summarizes functions related to PHP arrays. Share it with you for your reference. The details are as follows: the function name and usage are described here. no...

Related Article

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.