Home >Backend Development >PHP Problem >What are the common array functions in PHP?

What are the common array functions in PHP?

藏色散人
藏色散人Original
2020-06-30 10:01:093340browse

php Common array functions include: 1. "array_count_values" function, used to count all values ​​in the array; 2. "array_flip", used to exchange keys and values ​​in the array; 3. "array_multisort", Used for sorting multiple arrays or multi-dimensional arrays, etc.

What are the common array functions in PHP?

php common array functions

array_count_values ​​— Count all values ​​in the array

array_flip — Swap keys and values ​​in an array

array_merge — Merge one or more arrays

array_multisort — Sort multiple arrays or multidimensional arrays

array_pad — Sort by Fill a value into the array with a specified length

array_pop — pop the last element of the array (pop)

array_push — push one or more elements to the end of the array (push)

array_rand — Randomly (pseudo-randomly) remove one or more units from the array

array_keys — Return some or all key names in the array

array_values ​​— Return all keys in the array The value of

count — Counts the number of cells in an array, or the number of attributes in an object

sort — Sorts an array

If you want to know more about it, Please visit php中文网.

The above is the detailed content of What are the common array functions in PHP?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn