[ create a new paste ] login | about

Link: http://codepad.org/RIvLbyJy    [ raw code | output | fork ]

PHP, pasted on Aug 6:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
$rows = Array("email@gmail.com","test@gmail.com","tester@gmail.com","vin@gmail.com");

$contacts = Array
(
    "test@gmail.com" => "test@gmail.com",
    "ram@gmail.com" => "Ram",
    "vin@gmail.com" => "Vinay",
    "man_test@yahoo.com" => "Manoj",
    "homan@rediffmail.com" => "Homan"
);

$contacts = array_diff_key(array_map('trim', $contacts), array_map('trim', array_flip($rows)));
print_r($contacts);


Output:
1
2
3
4
5
6
Array
(
    [ram@gmail.com] => Ram
    [man_test@yahoo.com] => Manoj
    [homan@rediffmail.com] => Homan
)


Create a new paste based on this one


Comments: