<?php
class label{
	function func_iframe($content) {
		if(preg_match_all ("/\<iframe(.*?)\>(.*?)\<\/iframe\>/is",$content,$labelarr)){
			$count=count($labelarr[0]);
			for ($i=0;$i<$count;$i++) {		 																				$content=str_replace('</iframe>','',str_replace('<iframe>','',str_replace($labelarr[1][$i],'',$content)));
			} 			
		}
		return $content;
	}
	function func_object($content) {
		if(preg_match_all ("/\<object(.*?)\>(.*?)\<\/object\>/is",$content,$labelarr)){
			$count=count($labelarr[0]);
			for ($i=0;$i<$count;$i++) {		 																				$content=str_replace('</object>','',str_replace('<object>','',str_replace($labelarr[1][$i],'',str_replace($labelarr[2][$i],'',$content))));
			} 			
		}
		return $content;
	}
	function func_script($content) {
		$content=strtolower($content);
		if(preg_match_all ("/\<script(.*?)\>(.*?)\<\/script\>/is",$content,$labelarr)){
			$count=count($labelarr[0]);
			for ($i=0;$i<$count;$i++) {		 																				$content=str_replace('</script>','',str_replace('<script>','',str_replace($labelarr[1][$i],'',str_replace($labelarr[2][$i],'',$content))));
			} 			
		}
		return $content;
	}
	function func_div($content) {
		if(preg_match_all ("/\<div(.*?)\>(.*?)\<\/div\>/is",$content,$labelarr)){
			$count=count($labelarr[0]);
			for ($i=0;$i<$count;$i++) {		 																				$content=str_replace('</div>','',str_replace('<div>','',str_replace($labelarr[1][$i],'',$content)));
			} 			
		}
		return $content;
	}
	function func_class($content) {
		if(preg_match_all ("/\<class(.*?)\>(.*?)\<\/class\>/is",$content,$labelarr)){
			$count=count($labelarr[0]);
			for ($i=0;$i<$count;$i++) {		 																				$content=str_replace('</class>','',str_replace('<class>','',str_replace($labelarr[1][$i],'',$content)));
			} 			
		}
		return $content;
	}
	function func_table($content) {
		if(preg_match_all ("/\<table(.*?)\>(.*?)\<\/table\>/is",$content,$labelarr)){
			$count=count($labelarr[0]);
			for ($i=0;$i<$count;$i++) {		 																				$content=str_replace('</table>','',str_replace('<table>','',str_replace($labelarr[1][$i],'',$content)));
			} 			
		}
		return $content;
	}
	function func_tr($content) {
		if(preg_match_all ("/\<tr(.*?)\>(.*?)\<\/tr\>/is",$content,$labelarr)){
			$count=count($labelarr[0]);
			for ($i=0;$i<$count;$i++) {		 																				$content=str_replace('</tr>','',str_replace('<tr>','',str_replace($labelarr[1][$i],'',$content)));
			} 			
		}
		return $content;
	}
	function func_span($content) {
		if(preg_match_all ("/\<span(.*?)\>(.*?)\<\/span\>/is",$content,$labelarr)){
			$count=count($labelarr[0]);
			for ($i=0;$i<$count;$i++) {		 																				$content=str_replace('</span>','',str_replace('<span>','',str_replace($labelarr[1][$i],'',$content)));
			} 			
		}
		return $content;
	}
	function func_font($content) {
		if(preg_match_all ("/\<font(.*?)\>(.*?)\<\/font\>/is",$content,$labelarr)){
			$count=count($labelarr[0]);
			for ($i=0;$i<$count;$i++) {		 																				$content=str_replace('</font>','',str_replace('<font>','',str_replace($labelarr[1][$i],'',$content)));
			} 			
		}
		return $content;
	}
	function func_a($content) {
		if(preg_match_all ("/\<a(.*?)\>(.*?)\<\/a\>/is",$content,$labelarr)){
			$count=count($labelarr[0]);
			for ($i=0;$i<$count;$i++) {		 																				$content=str_replace('</a>','',str_replace('<a>','',str_replace($labelarr[1][$i],'',$content)));
			} 			
		}
		return $content;
	}
	function func_td($content) {
		if(preg_match_all ("/\<td(.*?)\>(.*?)\<\/td\>/is",$content,$labelarr)){
			$count=count($labelarr[0]);
			for ($i=0;$i<$count;$i++) {		 																				$content=str_replace('</td>','',str_replace('<td>','',str_replace($labelarr[1][$i],'',$content)));
			} 			
		}
		return $content;
	}
	function func_p($content) {
		if(preg_match_all ("/\<p(.*?)\>(.*?)\<\/p\>/is",$content,$labelarr)){
			$count=count($labelarr[0]);
			for ($i=0;$i<$count;$i++) {		 																				$content=str_replace('</p>','',str_replace('<p>','',str_replace($labelarr[1][$i],'',$content)));
			} 			
		}
		return $content;
	}
	function func_img($content) {
		if(preg_match_all('#<img.*?src\s*=\s*["\'](.*?)["\'].*?>#is',$content,$labelarr)){
			$count=count($labelarr[0]);
			for ($i=0;$i<$count;$i++) {
				$content=str_replace($labelarr[0][$i],'',$content);
			}
		}
		return $content;
	}
	function func_br($content) {
		$content=str_replace('br','',$content);
		return $content;
	}
	function func_html($content) {
		$content=strip_tags($content);
		return $content;
	}
}
$obj=new label();
function strip_tag($label,$content) {
	global $obj;
	switch ($label) {
		case 'iframe':
			$membody=$obj->func_iframe($content);
		break;
		case 'object':
			$membody=$obj->func_object($content);
		break;
		case 'script':
			$membody=$obj->func_script($content);
		break;
		case 'div':
			$membody=$obj->func_div($content);
		break;
		case 'class':
			$membody=$obj->func_class($content);
		break;
		case 'table':
			$membody=$obj->func_table($content);
		break;
		case 'tr':
			$membody=$obj->func_tr($content);
		break;
		case 'span':
			$membody=$obj->func_span($content);
		break;
		case 'font':
			$membody=$obj->func_font($content);
		break;
		case 'a':
			$membody=$obj->func_a($content);
		break;
		case 'td':
			$membody=$obj->func_td($content);
		break;
		case 'p':
			$membody=$obj->func_p($content);
		break;
		case 'img':
			$membody=$obj->func_img($content);
		break;
		case 'br':
			$membody=$obj->func_br($content);
		break;
		case 'html':
			$membody=$obj->func_html($content);
		break;
	}
	return $membody;
}
?>