Custom Full-Text Search Against Stopwords Too Particular Characters Using Php Too Mysql

I'm non certain if this is the best way.
To construct clean I expire the information through this class, all it does is strip out whatsoever especial characters, together with a listing of halt words that I don't desire to include inwards searches:
 <?php  shape Cleaner {      var $stopwords = array(" detect ", " well-nigh ", " me ", " e'er ", " each ", " update ", " delete ", " add together ", " insert ",  " where ", " i ", " a ", " my ");//you quest to extend this big time.      var $symbols = array('/','\\','\'','"',',','.','<','>','?',';',':','[',']','{','}','|','=','+', '-','_',')','(','*','&','^','%','$','#','@','!',' ','`');      constituent parseString($string) {         $string = ' '.$string.' ';         $string = $this->removeStopwords($string);         $string = $this->removeSymbols($string);         provide $string;     }      constituent removeStopwords($string) {         for ($i = 0; $i < sizeof($this->stopwords); $i++) {             $string = str_replace($this->stopwords[$i],' ',$string);         }          provide trim($string);     }      constituent removeSymbols($string) {         for ($i = 0; $i < sizeof($this->symbols); $i++) {             $string = str_replace($this->symbols[$i],' ',$string);         }          provide trim($string);     } }  
Source : http://stackoverflow.com/a/9082165
Sumber http://developer-paradize.blogspot.com

Comments

Popular posts from this blog

What Are The Main Components of a Computer System

Top Qualities To Look For In An IT Support Team

How To Integrate Google Adwords Api Into Codeigniter?