Skip to content

January 18, 2005

문자열 내의 HTML 태그를 모두 없애는 방법

문자열 내의 HTML 태그를 모두 없애는 방법

출처 : http://korea.internet.com/etc/talkback/talkback_content.asp?id=11447&cid=189&nid=28430

<?
function stripHTML($str){
return eregi_replace(“[<][^>]*[>]“, “”, $str);
}
이미지는 살려놓으려면
function stripHTML($str){
return eregi_replace(“[<][^img][^>]*[>]“, “”, $str);
}
?>

Read more from PHP

Share your thoughts, post a comment.

Note: HTML is allowed. Your email address will never be published.

Subscribe to comments