[ create a new paste ] login | about

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

PHP, pasted on Jul 26:
1
2
3
4
5
<?php
$array1 = array(0 => 10, 1 => 21, 2 => 34, 'somekey' => 45, 'otherkey' => 15);
$array2 = array(0 => 9, 1 => 10, 2 => 14, 'otherkey' => 15, 'somekey' => 43);
$array3 = array_intersect( $array1, $array2);
print_r( array_values( $array3));


Output:
1
2
3
4
5
Array
(
    [0] => 10
    [1] => 15
)


Create a new paste based on this one


Comments: