PHP pos() Function6 Jan 2025 | 1 min read 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. SyntaxParameter
ReturnsThe pos( ) function returns the value of the current element in an array or false on empty elements. Example 1Output: aajtak Example 2Output: aajtak zeenews Example 3Output: archery badminton badminton Example 4Output: archery badminton badminton archery badminton Next TopicPhp-array-prev-function |
The array_intersect_assoc() is used to create an array containing keys and values of the first array whose values (i.e., from the first array) are present in all other arrays, while the index of values is same for all the given arrays. This function was introduced...
1 min read
The array_combine() function is an inbuilt function in PHP. This function is introduced in PHP 5. It is used to create an array by using one array for keys and another for its values. Syntax array_combine(array_keys,array_values); Parameter Description Is compulsory array_keys The keys of the array to be used compulsory array_values The values of the...
1 min read
The array_sum( ) function is an inbuilt function of PHP. The array_sum( ) function calculates the sum of values in an array and returns the sum of values in an array as an integer or float. This function was introduced in PHP 4.0.4. Syntax number array_sum (...
1 min read
The array_multisort() is an built-in function in PHP. This function is used to sort multiple arrays at once or a multi-dimensional array with each dimension. This function was introduced in PHP 4.0. Syntax bool array_multisort ( array &$array1 [, mixed $array1_sort_order = SORT_ASC [, mixed$array1_sort_flags = SORT_REGULAR...
2 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
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
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_uintersect_uassoc( ) is an inbuilt function of PHP. The array_uintersect_uassoc() function uses two user-defined functions to compare the keys and values of two or more arrays, and returns the matches. This function was introduced in PHP 5.0. Syntax array array_uintersect_uassoc ( array $array1 , array $array2...
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_intersect_uassoc( ) function is an inbuilt function in PHP. The array_intersect_uassoc( ) function is used to compare key and values of two or more arrays by using a user-defined comparison function and return the matches. It returns an array containing all the values of...
2 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