Search this blog
Results";
echo 'Search terms: "' . $string . '"';
echo "Static Pages
";
$dir = new RecursiveDirectoryIterator("./sticky");
echo "";
$i=0;
foreach (new RecursiveIteratorIterator($dir) as $filename => $file) {
if ($file != "." && $file != "..") {
if (!is_dir($file)) {
$content = strtolower(file_get_contents($file->getPathname()));
if (strpos($content, $string) !== false) {
$i++;
preg_match("/(.*?)<\/h2>/s", $content, $titre);
$title = "?";
if (isset($titre[1])) {
$title = ucfirst($titre[1]);
}
echo '
- ' . $title . "
";
}
}
}
}
if ($i == 0) echo "No match";
echo "
";
echo "Articles
";
$dir = new RecursiveDirectoryIterator("./articles");
echo "";
$i=0;
foreach (new RecursiveIteratorIterator($dir) as $filename => $file) {
if ($file != "." && $file != "..") {
if (!is_dir($file)) {
$content = strtolower(file_get_contents($file->getPathname()));
if (strpos($content, $string) !== false) {
$i++;
preg_match("/(.*?)<\/h2>/s", $content, $titre);
$title = "?";
if (isset($titre[1])) {
$title = ucfirst($titre[1]);
}
echo '
- ' . $title . "
";
}
}
}
}
if ($i == 0) echo "No match";
echo "
";
} ?>
§