PHP array_arsort( ) function6 Jan 2025 | 1 min read The array_arsort( ) function is an inbuilt function of PHP. The array_arsort( ) function is used to sort an array in reverse order and the function maintains index association. This function was introduced in 4.0. SyntaxParameters
Return ValuesThe array_arsort( ) function returns true on success and false on failure. Example 1Output: Array ( [1] =>noida [2] =>hyderabad [0] => Bengaluru ) Example 2Output: Array ( [OS] => 95 [data structure] => 89 [compiler] => 68 ) Example 3Output: Array ( [ganguly] => 46 [sachin] => 45 [virat] => 29 ) Example 4Output: Array ( [c] =>yamuna [b] =>narmada [a] => ganga ) Next TopicPhp-array-asort-function |
The array_slice() function is an inbuilt function of PHP. The array_slice() function is used to extract a slice of an array. This function was introduced in 4.0. Syntax array array_slice ( array $array , int $offset [, int $length = NULL [, bool $preserve_keys = FALSE ]]...
1 min read
PHP list() Function The PHP list( ) function is used to assign values to a list of variables in one operation. This function was introduced in PHP 4.0. Syntax array list ( mixed $var1 [, mixed $... ] ); Parameter Parameter Description Is compulsory Variable1 The first variable to assign a value to. compulsory Variable2... More variables...
1 min read
PHP current() Function The current( ) function is an inbuilt function of PHP, and it is used to return the value of the current element in an array. This function was introduced in PHP 4.0. Syntax mixed current ( array $array ); Parameters Parameter Description Is compulsory array Specifies the array to use. compulsory Return Values The...
1 min read
PHP array_count_values() Function The array_count_values() function returns an array where the keys are the original array's values, and the values is the number of occurrences. In other words, we can say that array_count_values() function is used to calculate the frequency of all of the elements of...
1 min read
PHP () Function The PHP ( ) function is used to advance the internal array pointer. It advances the internal array pointer one place forward before returning the element value. This function was introduced in PHP 4.0. Syntax mixed ( array &$array ); Parameter Parameter Description Is compulsory array Specifies the array to...
1 min read
The count( ) function is an inbuilt function of PHP, and it is used to count the elements of an array or the properties of an object. This function was introduced in PHP 4.0. Syntax int count ( mixed $array_or_countable [, int $mode = COUNT_NORMAL ] ); Parameters Parameter Description Is...
1 min read
PHP array diff_ukey() Function The array_diff_ukey() is an inbuilt function in PHP. The array_diff_ukey() function compares the keys of two or more arrays with a user-defined function, and returns an array that contains the entries from array1 that are not present in array2 or array3, etc. This...
2 min read
The array_diff_assoc() function is used to compare an array against another array and returns the difference. In other words, we can say that array_diff_assoc() function compares the keys and values of two or more arrays and return an array that contains the entries from array1...
1 min read
The array_key_first( ) function is used to get the first key of an array. This function was introduced in PHP 7.3.0 Syntax mixed array_key_first ( array $array ); Parameters Parameter Description Is compulsory array Specifies the array. compulsory Return Values The array_key_first( ) function returns the first key of the array if the array is not...
1 min read
The array_reduce() function is a inbuilt function of PHP. The array_reduce( ) function is used to reduce the array to a single value using a callback function. This function was introduced in PHP 4.0.5. Syntax mixed array_reduce ( array $array , callable $callback [, mixed $initial =...
1 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India