Your search for '.$q.''.$rs.'
'; while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { // reset $matches = array(); $match1 = explode(" ", $line['content']); $match2 = explode(" ", strtolower($line['content'])); $ql = strtolower($q); foreach($match2 as $key => $value) { if(strstr($value, $ql) !== false) { $matches[] = $key; } } $start = $matches[0] - 5; $end = $matches[0] + 5; $context = array_slice($match1, $start, $end); $context2 = implode(" ", $context); $context2 = str_ireplace($q, ''.$q.'', $context2); // $context = array_search(strtolower($q), $match2); if($context2 !== '') { $context3 = '...'.$context2.'...'.$line['title'].'
';
echo $context3;
echo 'newbold.name/'.$line['page'].'/
Your search for '.$q.''.$rs.'
'; } if(isset($connection)) mysql_close($connection); } else { echo 'You can search the content on this site using the form above.
'; } ?>