PHP Highlight [yinelenen]

0 Cevap php

Possible Duplicate:
highlighting search results in php/mysql

Ben bu gibi, MSSQL, bir sorgu ile bir arama yapıyorum:

SELECT ctext FROM Table WHERE ctext like '%filter%'

Sonra, ben php ile hit vurgulamak isteyen am:

 function highlightme($str, $filter){
     $html = "<FONT style=".chr(34)."BACKGROUND-COLOR: yellow".
     chr(34).">".$filter."</FONT></P>";
     $buf = str_replace($filter,$html,$str);
     return $buf;
 }

But, if the filter was 'Hello', and ctext contains 'hello', the SQL brings it, but php does not highlight it (I think it has to do with case sensitive) And, If the filter was, 'hellos' and ctext contains 'hello', the SQL brings it, but php does not hightlight it either.

Nasıl bu iki şeyi çözebilir?

0 Cevap