¡Ø ±¤°í¼º±ÛÀº »çÀü µ¿ÀÇ ¾øÀÌ »èÁ¦ ÇÕ´Ï´Ù.
  Á¤±Ô½ÄÀ» ÅëÇÑ Á¦°Å ÁÙ¹Ù²Þ Á¦°Å ¹øÈ£ : 558 ¹ø±Û        Á¶È¸ : 663 ȸ
ÀÛ    ¼º    ÀÚ : Ȳȫ±¸  ¸ÞÀÏ º¸³»±â

 

1. Á¤±Ô½ÄÀ» ÅëÇÑ Á¦°Å ÁÙ¹Ù²Þ Á¦°Å

1$text = preg_replace('/\r\n|\r|\n/','',$text);

2. ¹®ÀÚ¿­ ÇÔ¼ö»ç¿ëÀ¸·Î Á¦°Å

123$text = str_replace(array("\r\n","\r","\n"),'',$text);¶Ç´Â$text = strtr($text,array("\r\n"=>'',"\r"=>'',"\n"=>''));

html ÅÂ±× Á¦°Å

1$content = preg_replace("(\<(/?[^\>]+)\>)", "", $content);

textarea Á¦°Å

12$content = preg_replace("!<textarea(.*?)>!is","[textarea]",$content);$content = preg_replace("!</textarea(.*?)>!is","[/textarea]",$content);

script Á¦°Å

1$str=preg_replace("!<script(.*?)<\ script="">!is","",$str);

iframe Á¦°Å

1$str=preg_replace("!<iframe(.*?)<\ iframe="">!is","",$str);

meta Á¦°Å

1$str=preg_replace("!<meta(.*?)>!is","",$str);

style ÅÂ±× Á¦°Å

1$str=preg_replace("!<style(.*?)<\ style="">!is","",$str);

&nbsp;¸¦ °ø¹éÀ¸·Î º¯È¯

1$str=str_replace(" "," ",$str);

¿¬¼ÓµÈ °ø¹é 1°³·Î

1$str=preg_replace("/\s{2,}/"," ",$str);

ű׾ȿ¡ style= ¼Ó¼º Á¦°Å

12$str=preg_replace("/ style=([^\"']+) /"," ",$str); // style=border:0 µû¿ÈÇ¥°¡ ¾øÀ»¶§$str=preg_replace("/ style=(\"|')?([^\"']+)(\"|')?/","",$str); // style="border:0" µû¿ÈÇ¥ ÀÖÀ»¶§

ű׾ÈÀÇ width=, height= ¼Ó¼º Á¦°Å

12$str=preg_replace("/ width=(\"|')?\d+(\"|')?/","",$str);$str=preg_replace("/ height=(\"|')?\d+(\"|')?/","",$str);

img ÅÂ±× ÃßÃâ src ÃßÃâ

12preg_match("/<img[^>]*src=[\"']?([^>\"']+)[\"']?[^>]*>/i",$str,$result);preg_match_all("/<img[^>]*src=[\"']?([^>\"']+)[\"']?[^>]*>/i",$str,$result);

Ư¼ö¹®ÀÚ Á¦°Å

1$string = preg_replace("/[ #\&\+\-%@=\/\\\:;,\.'\"\^`~\_|\!\?\*$#<>()\[\]\{\}]/i", "", $string);

°ø¹éÁ¦°Å

12$string = preg_replace('/ /', '', $string);$string = preg_replace("/\s+/", "", $string);

¹Ýº¹ ÀÔ·ÂµÈ ´Ü¾î Á¦°Å

1$string = preg_replace("/s(w+s)1/i", "$1", $string);

¹Ýº¹ ÀÔ·ÂµÈ ºÎÈ£ Á¦°Å

1$string = preg_replace("/.+/i", ".", $string);

¿µ¹®ÀÚ¸¦ Á¦¿ÜÇÑ ¸ðµç ¹®ÀÚ Á¦°Å

1$string = preg_replace("/[^A-Za-z]/", "", $string);

¿µ¹®ÀÚ¿Í °ø¹é¹®ÀÚ(Space)¸¦ Á¦¿ÜÇÑ ¸ðµç ¹®ÀÚ¸¦ Á¦°Å

1$string = preg_replace("/[^A-Za-z|\x20]/", "", $string);

ASCII ¹üÁÖ ÄÚµå ¿µ¹®+Ư¼ö¹®ÀÚ¸¦ Á¦¿ÜÇÑ ¸ðµç ¹®ÀÚ¸¦ Á¦°Å

1$string = preg_replace("/[^\x20-\x7e]/", "", $string);

img ÅÂ±× ÃßÃâ

12preg_match_all("/<img[^>]*src=['\"]?([^>'\"]+)['\"]?[^>]*>/", $img, $matchs);print_r($matchs);</img[^></img[^></img[^></style(.*?)<\></meta(.*?)></iframe(.*?)<\></script(.*?)<\>

 

¸Þ¸ð³²±â±â ÇÑ±Û 150ÀÚ ¿µ¹®300ÀÚ À̳»
ÀÛ¼ºÀÚ         Æнº¿öµå                ÇöÀç  0 byte
[°ü·Ã±Û] ¾øÀ½ ÀÛ¼ºÀϽà : 2021-08-09 16:00:36
Copyright(c) 2003 xirom all right reserved vol.3
Contact xirom@xirom.net form more information