PHP Array, phparray_PHP Tutorial
PHP Array, phparray
Function |
Description |
array() |
Create an array. |
array_change_key_case() |
Returns an array whose keys are all uppercase or lowercase. |
array_chunk() |
Split an array into new array blocks. |
array_combine() |
Create a new array by merging two arrays. |
array_count_values() |
is used to count the number of occurrences of all values in the array. |
array_diff() |
Returns the difference array of two arrays. |
array_diff_assoc() |
Compare the key name and key value, and return the difference array of the two arrays. |
array_diff_key() |
Compare the key names and return the difference array of the two arrays. |
array_diff_uassoc() |
Calculate the difference set of the array by doing index checking through the callback function provided by the user. |
array_diff_ukey() |
Use the callback function to compare the key names and calculate the difference set of the array. |
array_fill() |
Fills the array with the given values. |
array_filter() |
Use the callback function to filter the elements in the array. |
array_flip() |
Swap the keys and values in the array. |
array_intersect() |
Calculate the intersection of arrays. |
array_intersect_assoc() |
Compares the key name and key value and returns the intersection array of the two arrays. |
array_intersect_key() |
Computes the intersection of arrays using key name comparison. |
array_intersect_uassoc() |
Calculate the intersection of arrays with index checking, and use callback functions to compare the indices. |
array_intersect_ukey() |
Use the callback function to compare the key names to calculate the intersection of the arrays. |
array_key_exists() |
Checks whether the given key or index exists in the array. |
array_keys() |
Returns all key names in the array. |
array_map() |
Apply the callback function to the cells of the given array. |
array_merge() |
Combine one or more arrays into one array. |
array_merge_recursive() |
Recursively merge one or more arrays. |
array_multisort() |
Sort multiple arrays or multidimensional arrays. |
array_pad() |
Pall the array to the specified length with values. |
array_pop() |
Pop (pop) the last element of the array. |
array_product() |
Calculates the product of all values in an array. |
array_push() |
Push one or more cells (elements) to the end of the array (push). |
array_rand() |
Randomly select one or more elements from the array and return it. |
array_reduce() |
Use a callback function to iteratively reduce the array to a single value. |
array_reverse() |
Reverse the order of elements in the original array, create a new array and return it. |
array_search() |
Search for the given value in the array and return the corresponding key name if successful. |
array_shift() |
Deletes the first element in the array and returns the value of the deleted element. |
array_slice() |
Remove a value from the array based on the condition and return it. |
array_splice() |
Remove a part of the array and replace it with other values. |
array_sum() |
Calculate the sum of all values in an array. |
array_udiff() |
Use callback function to compare data to calculate the difference of arrays. |
array_udiff_assoc() |
Calculate the difference set of arrays with index checking, and use callback functions to compare data. |
array_udiff_uassoc() |
With index check, calculate the difference set of the array, and use the callback function to compare the data and index. |
array_uintersect() |
Calculate the intersection of arrays and use callback functions to compare data. |
array_uintersect_assoc() |
Calculate the intersection of arrays with index checking and use callback functions to compare data. |
array_uintersect_uassoc() |
Calculate the intersection of arrays with index checking and use callback function to compare data and index. |
array_unique() |
Remove duplicate values from the array. |
array_unshift() |
Insert one or more elements at the beginning of the array. |
array_values() |
Returns all values in the array. |
array_walk() |
Apply a user function to each member of the array. |
array_walk_recursive() |
Apply the user function recursively to each member of the array. |
arsort() |
Sort the array in reverse order and maintain the index relationship. |
asort() |
Sort the array and maintain the index relationship. |
compact() |
Create an array including variable names and their values. |
count() |
Calculate the number of elements in an array or the number of attributes in an object. |
current() |
Returns the current element in the array. |
each() |
Returns the current key/value pair in the array and moves the array pointer forward one step. |
end() |
Sets the array's internal pointer to the last element. |
extract() |
Import variables from the array into the current symbol table. |
in_array() |
Checks whether the specified value exists in the array. |
key() |
Get the key name from the associative array. |
krsort() |
Sort the array in reverse order by key name. |
ksort() |
Sort the array by key name. |
list() |
Assign the values in the array to some variables. |
natcasesort() |
Sort the array in a case-insensitive manner using the "natural sorting" algorithm. |
natsort() |
Sort the array using the "natural sorting" algorithm. |
next() |
Moves the internal pointer in the array forward one position. |
pos() |
An alias for current(). |
prev() |
Rewind the internal pointer of the array by one bit. |
range() |
Creates an array containing the specified range of elements. |
reset() |
Set the internal pointer of the array to the first element. |
rsort() |
Sort the array in reverse order. |
shuffle() |
Rearrange the elements in the array in random order. |
sizeof() |
An alias for count(). |
sort() |
Sort the array. |
uasort() |
Use a user-defined comparison function to sort values in an array and maintain index association. |
uksort() |
Use a user-defined comparison function to sort the keys in the array. |
usort() |
Sort the values in an array using a user-defined comparison function. |

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Title: Example of using the Array.Sort function to sort an array in C# Text: In C#, array is a commonly used data structure, and it is often necessary to sort the array. C# provides the Array class, which has the Sort method to conveniently sort arrays. This article will demonstrate how to use the Array.Sort function in C# to sort an array and provide specific code examples. First, we need to understand the basic usage of the Array.Sort function. Array.So

In PHP, there are many powerful array functions that can make array operations more convenient and faster. When we need to combine two arrays into an associative array, we can use PHP's array_combine function to achieve this operation. This function is actually used to combine the keys of one array as the values of another array into a new associative array. Next, we will explain how to use the array_combine function in PHP to combine two arrays into an associative array. Learn about array_comb

When programming in PHP, we often need to merge arrays. PHP provides the array_merge() function to complete array merging, but when the same key exists in the array, this function will overwrite the original value. In order to solve this problem, PHP also provides an array_merge_recursive() function in the language, which can merge arrays and retain the values of the same keys, making the program design more flexible. array_merge

In PHP programming, array is a very important data structure that can handle large amounts of data easily. PHP provides many array-related functions, array_fill() is one of them. This article will introduce in detail the usage of the array_fill() function, as well as some tips in practical applications. 1. Overview of the array_fill() function The function of the array_fill() function is to create an array of a specified length and composed of the same values. Specifically, the syntax of this function is

Java is a very powerful programming language that is widely used in various development fields. However, during Java programming, developers often encounter ArrayIndexOutOfBoundsException exceptions. So, what are the common causes of this anomaly? ArrayIndexOutOfBoundsException is a common runtime exception in Java. It means that when accessing data, the array subscript exceeds the range of the array. Common reasons include

In PHP programming, array is a frequently used data type. There are also quite a few array operation functions, including the array_change_key_case() function. This function can convert the case of key names in the array to facilitate our data processing. This article will introduce how to use the array_change_key_case() function in PHP. 1. Function syntax and parameters array_change_ke

The toArray() method of the LinkedList class converts the current LinkedList object into an array of object type and returns it. This array contains all the elements in this list in correct order (from first element to last element). It acts as a bridge between array-based and collection-based APIs. So, convert LinkedList to array - instantiate LinkedList class. Populate it using the add() method. Call the toArray() method on the linked list created above and retrieve the array of objects. Converts each element of an array of objects to a string. Example Real-time demonstration of importjava.util.Arrays;importjava.uti

In Java development, we often use arrays to store a series of data because of the convenience and performance advantages of arrays. However, in the process of using arrays, some exceptions will occur, and one of the common exceptions is ArrayStoreException. This exception is thrown when we store incompatible data types in the array. This article will introduce what an ArrayStoreException is, why it occurs, and how to solve it. 1. Arr
