public function search(array $rows, $query, $threshold = 3)
    {
        $matched = [];

        foreach($rows as $row)
        {
            $distance = $this->calculateDistance($query, $row);

            if ($threshold >= $distance)
            {
                $matched[] = [$distance, $row];
            }
        }

        return $this->transformResult($this->sortMatchedStrings($matched));
    }
public function search(array $rows, $query, $threshold = 3)
    {
        $matched = [];

        foreach($rows as $row)
        {
            $distance = $this->calculateDistance($query, $row);

            if ($threshold >= $distance)
            {
                $matched[] = [$distance, $row];
            }
        }

        return $this->transformResult($this->sortMatchedStrings($matched));
    }
public function search ( array $ rows , $ query , $ threshold = 3 ) { $ matched = [ ] ; foreach ( $ rows as $ row ) { $ distance = $ this -> calculateDistance ( $ query , $ row ) ; if ( $ threshold >= $ distance ) { $ matched [ ] = [ $ distance , $ row ] ; } } return $ this -> transformResult ( $ this -> sortMatchedStrings ( $ matched ) ) ; }
Perform a fuzzy string searching.

@param array $rows
@param string $query
@param integer $threshold
@return array
Perform a fuzzy string searching .