PHP array_diff_key() Function6 Jan 2025 | 1 min read This is an inbuilt function of PHP. This function was introduced in PHP 5.1. The array_diff_key() function compares the keys of two or more arrays, and returns entries from array1 that are not present in array2 or array3, etc. Syntax
Return TypeReturns an array containing the entries from array1 that are not present in any of the other arrays. Example 1Output: Array ( [3]=> Boi ) Example 2Output: Array( [20] => Laxman [30] => Rahul [40] => Ganguly [50] => Yuvi ) Example 3Output: Array ( [b] => Bed ) Example 4Output: Array ( [a1]=> red [c3]=> blue [d4]=> black ) Next TopicPhp-array-diff-uassoc-function |
The array_replace_recursive() function is an inbuilt function of PHP. The array_replace_recursive( ) function is used to replace the values from passed arrays into the first array recursively. This function was introduced in PHP 5.3.0. Syntax array array_replace_recursive ( array $array1 [, array $... ] ); Parameter Parameter Description Is compulsory array1 Specifies an...
2 min read
The array_udiff_assoc( ) function is an inbuilt function of PHP. The array_udiff_assoc( ) function use a built-in function to compare the keys and values of two or more arrays, and returns the differences. This function was introduced in PHP 5.0. Syntax array array_udiff_assoc ( array $array1 ,...
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
PHP krsort() Function The PHP krsort( ) function is used to sort the array elements by the key in descending order. It is mainly used in the associative array. This function was introduced in PHP 4.0. Syntax bool krsort ( array &$array [, int $sort_flags = SORT_REGULAR ]...
1 min read
The array_pop() function is inbuilt function of PHP. The array_pop() function is used to remove the last element of an array. For an empty array, this function returns NULL. This function was introduced in PHP 4.0. Syntax mixed array_pop ( array &$array ); Parameters Parameter Description Required/Optional array Specifies an array. compulsory Return Type The array_pop()...
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_uintersect_assoc( ) function is an inbuilt function of PHP. The array_uintesect_assoc() function compares two or more arrays, and then returns an array containing the elements from the first array. This function was introduced in PHP 5.0. Syntax array array_uintersect_assoc ( array $array1 , array $array2 [,...
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
The in_array( ) function is an inbuilt function of PHP. It is used to search an array for a specific value. If the third parameter strict is set to true, the in_array( ) function will also check the types of the $values. Syntax bool in_array ( mixed...
1 min read
This function is inbuilt in PHP and it was introduced in PHP 5. The function array_diff_uassoc() is used to compute the difference of arrays with additional index check which is performed by a user supplied callback function. In simple words, the function compares array1 against array2...
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