Function noHTML ($ content) { $ Content = preg_replace ("/<a [^>] *>/I", '', $ content ); $ Content = preg_replace ("/</a>/I", '', $ content ); $ Content = preg_replace ("/<div [^>] *>/I", '', $ content ); $ Content = preg_replace ("/</div>/I", '', $ content ); $ Content = preg_replace ("/<font [^>] *>/I", '', $ content ); $ Content = preg_replace ("/</font>/I", '', $ content ); $ Content = preg_replace ("/<p [^>] *>/I", '', $ content ); $ Content = preg_replace ("/</p>/I", '', $ content ); $ Content = preg_replace ("/<span [^>] *>/I", '', $ content ); $ Content = preg_replace ("/</span>/I", '', $ content ); $ Content = preg_replace ("/<? Xml [^>] *>/I ",'', $ content ); $ Content = preg_replace ("/</? Xml>/I ",'', $ content ); $ Content = preg_replace ("/<o: p [^>] *>/I", '', $ content ); $ Content = preg_replace ("/</o: p>/I", '', $ content ); $ Content = preg_replace ("/<u [^>] *>/I", '', $ content ); $ Content = preg_replace ("/</u>/I", '', $ content ); $ Content = preg_replace ("/<B [^>] *>/I", '', $ content ); $ Content = preg_replace ("/</B>/I", '', $ content ); $ Content = preg_replace ("/<meta [^>] *>/I", '', $ content ); $ Content = preg_replace ("/</meta>/I", '', $ content ); $ Content = preg_replace ("/<! -- [^>] * -->/I ",'', $ content); // comment content $ Content = preg_replace ("/<p [^>] * -->/I", '', $ content); // comment content $ Content = preg_replace ("/style =. +? ['| "]/I", '', $ content); // remove the style $ Content = preg_replace ("/class =. +? ['| "]/I", '', $ content); // remove the style $ Content = preg_replace ("/id =. +? ['| "]/I", '', $ content); // remove the style $ Content = preg_replace ("/lang =. +? ['| "]/I", '', $ content); // remove the style $ Content = preg_replace ("/width =. +? ['| "]/I", '', $ content); // remove the style $ Content = preg_replace ("/height =. +? ['| "]/I", '', $ content); // remove the style $ Content = preg_replace ("/border =. +? ['| "]/I", '', $ content); // remove the style $ Content = preg_replace ("/face =. +? ['| "]/I", '', $ content); // remove the style $ Content = preg_replace ("/face =. +? ['| "]/", '', $ Content ); $ Content = preg_replace ("/face =. +? ['| "]/", '', $ Content ); $ Content = str_replace ("& nbsp;", "", $ content ); Return $ content; } |