* 스크립트안의 공백제거하기 - $str = preg_replace('/.*?<\/script>/ise', "str_replace(' ', '', '$0')", $str); * 태그안에 style= 속성 제거 - $str=preg_replace("/ zzstyle=([^\"\']+) /"," ",$str); // style=border:0 따옴표가 없을때 - $str=preg_replace("/ style=(\"|\')?
([^\"\']+)(\"|\')?/","",$str); // style="border:0" 따옴표 있을때 * 태그안의 width=, height= 속성 제거 - $str=preg_replace("/ width=(\"|\')?
\d+(\"|\')?/","",$str); - $str=preg_replace("/ height=(\"|\')?
\d+(\"|\')?/","",$str); * 특수문자 제거 - $string = preg_replace("/[ #\&\+...
#
preg_replace
#
공백제거
#
문자열제거
#
정규식
원문 링크 : preg_replace 예제