PHP rsort() Function6 Jan 2025 | 1 min read The PHP rsort( ) function is used to sort an array in reverse order. This function introduced in PHP 4.0. SyntaxParameter
ReturnsThe PHP rsort( ) function returns true on success or false on failure. Example 1Output: Array ( [0] => orange [1] => mango [2] => banana ) Example 2Output: Array ( [0] => 600 [1] => 400 [2] => 220 [3] => 110 [4] => 100 ) Example 3Output: Array ( [0] =>os [1] => java [2] =>dbms [3] => compiler ) Example 4Output: Array ( [0] =>nexon [1] =>hexa [2] =>audi ) Next TopicPhp-array-search-function |
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 array_push() function is a inbuilt function in PHP. The array_push() function is used to add one or more elements onto the end of an array. The length of array increases by the number of variables pushed. The array_push() function was introduced in PHP 4.0. Syntax int...
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
The array_map( ) is an built-in function in PHP. The array_map( ) function sends each value of an array to a user-defined function, and returns an array with new values given by the user-defined function. This function was introduced in 4.0.6. Syntax array array_map ( callable $callback...
1 min read
The array_diff() function compares two or more arrays and returns an array with the keys and values from the first array, only if the value is not present in any of the other arrays. This function was introduced in PHP 4.0. Syntax array_diff(array1,array2,array3...); Parameter Description Is compulsory array1 The array to compare...
2 min read
PHP end() Function The end( ) function is an inbuilt function of PHP. The end() function Set the internal pointer of an array to its last element. This function was introduced in 4.0. Syntax mixed end ( array &$array ); Parameter Parameter Description Is compulsory array Specifies the array to use. compulsory Returns The end( ) function...
1 min read
The array_keys() function is used to get all the keys or a subset of the keys of an array. It returns the keys, numeric and string, from the input array. This function was introduced in PHP 4.0. Syntax array_keys(array1,value,strict); Parameter Parameter Description Is compulsory array Specifies an array. compulsory search_value Specify a value, then only the...
1 min read
The array_rand()function is a inbuilt function in PHP. The array_rand()function is used to fetch one or more random entries from an array. It uses a pseudo-random number generator that is not suitable for cryptographic purposes. This function was introduced in PHP 4.0. Syntax mixed array_rand ( array...
1 min read
The array_search() function is an inbuilt function of PHP. It is used to search the array against the given value. The function returns the first corresponding key if successful. This function was introduced in PHP 4.0.5. Syntax mixed array_search ( mixed $needle , array $haystack [, bool...
1 min read
The array_merge( ) function is a built-in function of PHP. This function is used to merge the elements or values of two or more arrays together into a single array. This function was introduced in PHP 4.0. Syntax array array_merge(array $array1[, array $...]); Parameter Parameter Description Is compulsory array1 Specifies an array. compulsory array2 Specifies an...
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