Copyright © tutorialspoint.com

PHP Function array_uintersect_uassoc()

previous
Advertisements

Syntax

array_uintersect_assoc( $array1, $array2 [, $array3 ..., $func1], $func2 );

Definition and Usage

This function returns an array containing all the values of array1 that are present in all the arguments array2, array3.

Paramters

ParameterDescription
array1Required. Specifies an array.
array2Required. Specifies an array to be compared with the first array.
array3Optional. Specifies an array to be compared with the first array.
func1Required. The name of the user-made function that compares the array keys.
func2Required. The name of the user-made function that compares the array values.

Example

Try out following example:

<?php
$array1 = array("a"=>"green", "b"=>"brown", "c"=>"blue", "red");
$array2 = array("a"=>"GREEN", "B"=>"brown", "yellow", "red");

print_r(array_uintersect_uassoc($array1, $array2, 
                              "strcasecmp", "strcasecmp"));
?> 

This will produce following result:

Array
(
    [a] => green
    [b] => brown
)
previous

Copyright © tutorialspoint.com