array_product() can be used to implement a simple boolean AND search
<?php
$args = array('first_name'=>'Bill','last_name'=>'Buzzard');
$values[] = array('first_name'=>'Brenda','last_name'=>'Buzzard');
$values[] = array('first_name'=>'Victor','last_name'=>'Vulture');
$values[] = array('first_name'=>'Bill','last_name'=>'Blue Jay');
$values[] = array('first_name'=>'Bill','last_name'=>'Buzzard');
$result = search_for($values,$args);
var_dump($result);exit;
function search_for($array,$args) {
$results = array();
foreach ($array as $row) {
$found = false;
$hits = array();
foreach ($row as $k => $v) {
if (array_key_exists($k,$args)) $hits[$k] = ($args[$k] == $v);
}
$found = array_product($hits);
if (!in_array($row,$results) && true == $found) $results[] = $row;
}
return $results;
}
?>
Output:
array (size=1)
0 =>
array (size=2)
'first_name' => string 'Bill' (length=4)
'last_name' => string 'Buzzard' (length=7)