PHP array_uintersect_assoc() Function6 Jan 2025 | 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. SyntaxParameter
ReturnsThe array_uintersect_assoc( ) function returns an array containing the entries from array1 that are present in all the arguments. Example 1Output: Array ( [a] =>php ) Example 2Output: Array ( [a] => dell ) Example 3Output: Array ( [a] => Apple ) Example 4Output: Array ( [a] => Java [d] =>php ) Next TopicPhp-array-uintersect-function |
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 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_diff_assoc() function is used to compare an array against another array and returns the difference. In other words, we can say that array_diff_assoc() function compares the keys and values of two or more arrays and return an array that contains the entries from array1...
1 min read
PHP sort() Function The PHP sort( ) function is used to sort the array elements in ascending order. This function was introduced in PHP 4.0. Syntax bool sort ( array &$array [, int $sort_flags = SORT_REGULAR ] ); Parameter Parameter Description Is compulsory array Specifies the array to be sorted. compulsory Sort flags Sorting behavior. Possible type : SORT_REGULAR...
1 min read
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_product() function is inbuilt function of PHP. The array_product() function calculates the product of an array. This function was introduced in PHP 5.1.0. Syntax number array_product ( array $array ); Parameters Parameter Description Required/Optional array Specifies an array. compulsory Return Type The array_product() function returns the product as an integer or float. Example 1 <?php $prime=array(2,3,5,7); print_r(array_product($prime)); ?> Output: 210 Example 2 <?php $even=array(2,6); print_r($even); print_r(array_product($even)); echo "\n"; $odd=array(7,9); print_r($odd); print_r(array_product($odd)); ?> Output: Array ( ...
1 min read
The array_key_first( ) function is used to get the first key of an array. This function was introduced in PHP 7.3.0 Syntax mixed array_key_first ( array $array ); Parameters Parameter Description Is compulsory array Specifies the array. compulsory Return Values The array_key_first( ) function returns the first key of the array if the array is not...
1 min read
The compact( ) function is an inbuilt function of PHP, and it is used to create an array from variables and their values. This function was introduced in PHP 4+. Syntax array compact ( mixed $varname1 [, mixed $... ] ); Parameters Parameter Description Is compulsory Variable1 It can be either a string...
1 min read
PHP sizeof() Function The sizeof( ) function is an alias of count( ) function. The sizeof( ) function returns the number of elements in an array. This function was introduced in PHP 4.0. Syntax intsizeof(array, mode); Parameter Parameter Description Is compulsory array Specifies the array to use. compulsory mode Specifies the mode. Possible values: 0 - Default. Does...
1 min read
The array_values( ) function is an inbuilt function of PHP. It is used to get an array of values from another array that may contain key-value pairs. This function was introduced in PHP 4.0. Syntax array array_values ( array $array ); Parameters Parameter Description Is compulsory array Specifying an array. compulsory Return Values The array_values( )...
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