30) break; $stream = new SplFileObject($file); $grepped = new RegexIterator($stream, '/'.$searchStr.'/i'); foreach($grepped as $found) { $_text = $file; # this search for a headline tag and the result will be used as # the result text in the search results $headlines = new RegexIterator($stream,"/

([^<]+)<\/h2>/"); foreach($headlines as $headline) { $_text = trim($headline); $_text = strip_tags($_text); break; } $searchResult[] = array( 'href' => 'https://url.to/'.$file, 'text' => $_text ); $limit++; #var_dump($found); #var_dump($file); #var_dump($searchResult); #exit(); unset($headlines); unset($_text); break; } unset($stream); unset($grepped); } $searchCount = count($searchResult); } } # is it a tag? $tagDir = 'tags/'.$searchStr; if(file_exists($tagDir)) { $tagLink = $searchStr; } # is it a category? $topicsDir = 'topics/'.$searchStr; if(file_exists($topicsDir)) { $catLink = $searchStr; } } header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); ?> Suche nach: <?php echo $searchStr; ?>

Suche

Gesucht: | Gefunden:

Tag:

Kategorie:

Leider nichts gefunden.