I am having problems with my search engine and the function str_ireplace.
I read almost all documentation online possible, but it makes me really angry, because it does not work for my search engine.
I would like to make my keyword bold or highlighting it in the search results (you can try it online at http://www.geoinfo.us/ipa)
For example ... searching for keyword "ap" ,,, it should mark the following chunks of the words
application
applicant
apropriate
mapping
map
tape
tapping
etc.
Here is my code:
Code: Select all
// Search Output
$query = "SELECT * FROM $table WHERE word LIKE '%$word%'";
$result = mysql_query($query);
$nombre = mysql_numrows($result);
if ( $nombre == 0 ) {
echo "<font SIZE=$tablefontsize face=$tablefontface>";
echo $search_no_result;
echo "<BR>";
echo $search_specify;
echo "</font>";
}else{
echo $table_in;Code: Select all
echo "</td> $row_out \n";
while ($row < $nombre ){
$word = mysql_result($result,$row,"word");
$definition = mysql_result($result,$row,"definition");
$sampa = mysql_result($result,$row,"sampa");
if ($picsupport == "1") {$picurl = mysql_result($result,$row,"picurl");}
// Fill the table with data from the query
echo $row_in ;
echo "<td width='30%' valign=top bgcolor='#ECECEC'><font size=$tablefontsize face=$tablefontface>";
echo "$word";
echo "</font></td>\n";
echo "<td width='30%' bgcolor='#FFF5CE' valign=top><font size=$tablefontsize face=$tablefontface>";
echo "$definition";
echo "</font></td>";
echo "<td width='30%' bgcolor='#E2E8EE' valign=top><font size=$tablefontsize face=$tablefontface>";
echo "$sampa";
echo "</font></td>";