PHP reset() Function6 Jan 2025 | 1 min read The PHP reset( ) function is used to move the array's internal pointer to the first element. This function was introduced in PHP 4.0. SyntaxParameter
ReturnsThe reset( ) function returns the value of the first array element or false if the array is empty. Example 1Output: sachin Example 2Output: cat dog cat Example 3Output: os dbms java Example 4Output: os dbms os java Next TopicPhp-array-reverse-function |
The array_splice() function is an extended version of array_slice() function. The array_splice() function removes selected elements from an array and replaces it with new elements. This function was introduced in PHP 4. Syntax arrayarray_splice ( array &$input , int $offset [, int $length = count($input) [, mixed...
1 min read
The array_udiff( ) function is an inbuilt function of PHP. The array_udiff( ) function is used to compute the difference of given arrays by using a callback function for data comparison. This function was introduced in PHP 5.1.0. Syntax array array_udiff ( array $array1 , array $array2...
1 min read
PHP uksort() Function The PHP uksort( ) function is used to sort an array by the elements keys using a user-defined comparison function. This function was introduced in PHP 4.0. Syntax bool uksort ( array &$array , callable $key_compare_func ); Parameter Parameter Description Is compulsory array Specifies the array to be sorted. compulsory user_defined_function This function is...
2 min read
The array_replace() function is a built-in function in PHP. The PHP array_replace( ) function is used to replace the values of the first array with the values from following arrays. This function was introduced in PHP 5.3.0. Syntax array array_replace ( array $array1 [, array $... ]...
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
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 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
The array_filter( ) function filters the values of an array using a callback function. This function passes each value of the input array to the callback function. If the callback function returns true, the current value from the input is returned into the result array....
2 min read
The array_uintersect() is an inbuilt function in PHP. It is used to compute the intersection of two or more arrays depending on the values. The first array values are compared with all the other arrays with the help of an user-defined function, and the matches...
1 min read
PHP () Function The PHP ( ) function is used to fetch the array value in the ious place, pointed by the internal array pointer. This function was introduced in PHP 4.0. Syntax mixed ( array &$array ); Parameter Parameter Description Is compulsory array Specifies the array to use. compulsory Returns The ( ) function returns...
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