PHP current() Function6 Jan 2025 | 1 min read 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. SyntaxParameters
Return ValuesThe current( ) function returns the value of the current element in an array or false on empty elements. Example 1Output: javatpoint Example 2Output: udemy Example 3Output: udacity Example 4Output: edureka Next TopicPhp-array-diff-assoc-function |
PHP pos() Function The PHP pos( ) function is used to fetch the value of the current element in an array. The PHP pos( ) function is an alias of current( ) function. This function was introduced in PHP 4.0. Syntax pos($array); Parameter Parameter Description Is compulsory array Specifies the array to use. compulsory Returns The pos(...
1 min read
The array_shift() function is an inbuilt function of PHP. The array_shift( ) function is used to remove the first element from an array, and returns the value of the removed element. This function was introduced in PHP 4.0. Syntax mixed array_shift ( array &$array ); Parameter Parameter Description Is compulsory array name The...
1 min read
The array_key_exists( ) is an builtin function of PHP. The array_key_exists( ) function checks an array for a specified key, and returns true if the key exists and false if the key does not exists. This function was introduced in PHP 4.0.7. Syntax array_key_exists(key,array); Parameter Description Is compulsory key Specifies the key. compulsory array Specifies...
1 min read
PHP ksort() Function The PHP ksort() sorts an associative array in ascending order, according to the key. It is mainly used for an associative array. This function was introduced in PHP 4.0. Syntax bool ksort ( array &$array [, int $sort_flags = SORT_REGULAR ] ); Parameter Parameter Description Is compulsory array Specifies the array...
1 min read
PHP rsort() Function The PHP rsort( ) function is used to sort an array in reverse order. This function introduced in PHP 4.0. Syntax bool rsort ( array &$array [, int $sort_flags = SORT_REGULAR ] ); Parameter Parameter Description Is compulsory array Specifies the array to use. compulsory Sort flags It specifies how to sort the array...
1 min read
The array_intersect_ukey( ) function Computes the intersection of arrays using a callback function on the keys for comparison. The function returns an array containing all the values of the first array which have matching keys that are present in all the arguments. This function was...
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 key() Function The key( ) function returns the element key from the current internal pointer position. This function was introduced in 4.0. Syntax mixed key ( array $array ); Parameter Parameter Description Is compulsory array Specifies the array to use. compulsory Returns The key( ) returns the key of the array element that is currently being...
1 min read
PHP shuffle() Function The PHP shuffle( ) function is used to randomize the order of the elements in the array. The function assigns new keys to the elements in an array. This function introduced in PHP 4.0. Syntax bool shuffle ( array &$array ); Parameter Parameter Description Is compulsory array Specifies the array to...
1 min read
The array_key_last( ) function is used to get the last key of an array. This function was introduced in PHP 7.3.0 Syntax mixed array_key_last ( array $array ); Parameters Parameter Description Is compulsory array Specifies the array. compulsory Return Values The array_key_last( ) function returns the last key of the array if the array is not...
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