class search_match{
static $count=0;
static $match_array=array();
public function search($array,$find){
$spt =preg_split('/,/',$find);
for($i=0;$i<count($array);$i++){
if(self::toMatch($array[$i],$spt)){
self::$match_array[self::$count]=$array[$i];
self::$count++;
}
}
}
public function get_count(){
return self::$count;
}
public function get_array(){
return self::$match_array;
}
public static function toMatch($subject,$find){
for($j=0;$j<count($find);$j++){
$regex="/".$find[$j]."/";
if(!preg_match($regex,$subject)){
return false;
}
}
return true;
}
}