PHP - 특정 태그 및 문자열 추출, 제거
TEXTAREA 제거 $content = preg_replace("!!is","[TEXTAREA]",$content); $content = preg_replace("!!is","[/TEXTAREA]",$content); script 제거 $str=preg_replace("!\"']+)[\"']?[^>]*>/i",$str,$RESULT); preg_match_all("/]*src=[\"']?([^>\"']+)[\"']?[^>]*>/i",$str,$RESULT); 호스트 추출 preg_match("/^(http:\/\/)?([^\/]+)/i","http://www.naver.com/index.php",$matches); $host = $matches[2]; echo $matches[0]." "; echo $..
2023. 12. 17.
Copyright ⓒ SmartWeb All rights reserved.