Search: "; ?>

]*?>.*?@siu', '@]*?>.*?@siu', '@]*?.*?@siu', '@]*?.*?@siu', ), "", //replace above with nothing $str ); return $str; } if(isset($_GET['search'])){ $search = strip_tags(stripslashes($_GET['search'])); } else { $search = 'blockchain'; } if(isset($_GET['page'])){ $page = strip_tags(stripslashes($_GET['page'])); $c = $page + c; } if(isset($_GET['date'])){ $today = strip_tags(stripslashes($_GET['date'])); } else { $today = date('Y-m-d'); } $query1 = "SELECT DISTINCT `title`, `html`, `url`, `date` FROM `scraper`.`search` WHERE `search`.`date` = '".$today."';"; echo $query1; if ($stmt1 = mysqli_prepare($conn1, $query1)) { mysqli_stmt_execute($stmt1); mysqli_stmt_bind_result($stmt1, $title, $body, $key, $date); while (mysqli_stmt_fetch($stmt1)) { //$body = preg_replace("/]*>(.*?)<\/script>/is", "", $body); $e = 0; $count = 0; $word = ""; $snipe = ""; $sort = array(); $body = html_entity_decode($body); $body = strip_html_tags($body); $body = strip_tags(stripslashes($body)); $body = htmlentities($body); $i = $i + 1; $counter = substr_count($body, $search); $count = $counter + $count; echo $count; $needle = $search; $lastPos = 0; $positions = array(); while (($lastPos = strpos($body, $needle, $lastPos))!== false) { $seed = $lastPos; $positions[] = $lastPos; $lastPos = $lastPos + strlen($needle); } if($counter < 1) { } else { $word = $word." ".$search; $sort[$search] = $counter; //echo ""; //echo ""; // Displays 3 and 10 //echo "
          ".$title."   Link
"; foreach ($positions as $value) { $pos1 = $value + 75; $pos2 = $value - 25; $snippet = substr($body, $pos2, 200); $e = $e + 1; $snipe = $snipe." ".$snippet; //echo $snippet."
"; } echo "
          ".$count." ".$title."   Link 
"; } //echo $i; } } ?>