TeamTNT\TNTSearch\Support\Highlighter::_extractLocations PHP Метод

_extractLocations() публичный Метод

unless you decide to make the words unique before passing in
public _extractLocations ( $words, $fulltext )
    public function _extractLocations($words, $fulltext)
    {
        $locations = array();
        foreach ($words as $word) {
            $wordlen = strlen($word);
            $loc = stripos($fulltext, $word);
            while ($loc !== false) {
                $locations[] = $loc;
                $loc = stripos($fulltext, $word, $loc + $wordlen);
            }
        }
        $locations = array_unique($locations);
        sort($locations);
        return $locations;
    }