This is my array output -
print_r($array_email);
Array
(
[1] => Array
(
[0] => [email protected]
[1] => [email protected]
[2] => [email protected]
[3] => [email protected]
[4] => [email protected]
)
[2] => Array
(
[0] => [email protected]
)
[3] => Array
(
[0] => [email protected]
)
[4] => Array
(
[0] => [email protected]
)
)
Here i have tried - (but not working)
function get_duplicates( $array ) {
return array_unique( array_diff_assoc( $array, array_unique( $array ) ) );
}
print_r(get_duplicates($array_email));
I need output like that-
Array
(
[1] => Array
(
[1] => [email protected]
[2] => [email protected]
[4] => [email protected]
)
[2] => Array
(
[0] => [email protected]
)
[4] => Array
(
[0] => [email protected]
)
)