[ create a new paste ] login | about

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

PHP, pasted on Oct 2:
1
2
3
4
5
6
7
8
9
10
<?php

$filter1 = "red,green,blue,yellow";         
$parts1 = explode(',', $filter1);
$filter2 = "red,green,blue";        
$parts2 = explode(',', $filter2);


$result = array_intersect($parts1 , $parts2 );
print_r($result);


Output:
1
2
3
4
5
6
Array
(
    [0] => red
    [1] => green
    [2] => blue
)


Create a new paste based on this one


Comments: