public function multidimensionalSearch($parents, $searched)
    {
        if (empty($searched) || empty($parents)) {
            return false;
        }

        foreach ($parents as $key => $value) {
            $exists = true;
            foreach ($searched as $skey => $svalue) {
                $exists = $exists && isset($parents[$key][$skey]) && $parents[$key][$skey] === $svalue;
            }

            if ($exists) {
                return true;
            }
        }

        return false;
    }
public function multidimensionalSearch($parents, $searched)
    {
        if (empty($searched) || empty($parents)) {
            return false;
        }

        foreach ($parents as $key => $value) {
            $exists = true;
            foreach ($searched as $skey => $svalue) {
                $exists = $exists && isset($parents[$key][$skey]) && $parents[$key][$skey] === $svalue;
            }

            if ($exists) {
                return true;
            }
        }

        return false;
    }
public function multidimensionalSearch ( $ parents , $ searched ) { if ( empty ( $ searched ) || empty ( $ parents ) ) { return false ; } foreach ( $ parents as $ key => $ value ) { $ exists = true ; foreach ( $ searched as $ skey => $ svalue ) { $ exists = $ exists && isset ( $ parents [ $ key ] [ $ skey ] ) && $ parents [ $ key ] [ $ skey ] === $ svalue ; } if ( $ exists ) { return true ; } } return false ; }
Search for a data in a multidimensional array.

Example:
$parents = array();
$parents[] = array('date'=>1320883200, 'uid'=>3);
$parents[] = array('date'=>1320883200, 'uid'=>5);
$parents[] = array('date'=>1318204800, 'uid'=>5);
echo multidimensionalSearch($parents, array('date'=>1320883200, 'uid'=>5)); // true

@param array  $parents
@param string $searched

@return mixed
Search for a data in a multidimensional array .