최신글 뽑아오기에서 태그 없애기 안됨 ㅠ.ㅠ

김선일씨 끝내 피살 [06-23]

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0> <TBODY> <TR> <TD class=title height=60><SPAN id… more

이런식으로 나오네요..
태그좀 없애고 싶어요 절대로 안되네요


이것도 안되고

<?
$wr_content = strip_tags($list[$i][content]);
$wr_content = get_text(cut_str($wr_content, 2000, '..........'));

이것도 안됨
<?
$wr_content = cut_str(strip_tags($list[$i][commentcnt], "<style>"),2000,"…");
$wr_content = conv_content($wr_content, 1);
$wr_content = get_text($wr_content);
?>

방법좀 알켜주세요
?>

첨부파일

latest.skin.php (2.5 KB) 1회 2004-06-23 12:07
|

댓글 3개

저 소스를 대입하면 에러가 나옴 어떻게 하라는 거죠?
해당링크
http://phpschool.com/bbs2/inc_view.html?id=10911&code=tnt2&start=0&mode=&field=&search_name=&operator=&period=&category_id=&s_que=
다음을 참고하세요.

// HTML 특수문자를 변환
String.prototype.htmlChars = function () {
var str = ((this.replace('"', '&amp;')).replace('"', '&quot;')).replace('\'', '&#39;');
return (str.replace('<', '&lt;')).replace('>', '&gt;');
}

// 좌우 공백없애는 함수
String.prototype.trim = function () { return this.replace(/(^s*)|(s*$)/g, ""); }

// 왼쪽 공백없애는 함수
String.prototype.ltrim = function () { return this.replace(/^s*/g, ""); }

// 오른쪽 공백없애는 함수
String.prototype.rtrim = function () { return this.replace(/s*$/g, ""); }

// 태그만 제거
String.prototype.stripTags = function () {
var str = this;
var pos1 = str.indexOf('<');

if (pos1 == -1) return str;
else {
var pos2 = str.indexOf('>', pos1);
if (pos2 == -1) return str;
return (str.substr(0, pos1) + str.substr(pos2+1)).stripTags();
}
}

// 대소문자 구별하지 않고 단어 위치 찾기
String.prototype.ipos = function (needle, offset) {
var offset = (typeof offset == "number")?offset:0;
var pos1 = str.toLowerCase().indexOf(needle.toLowerCase(), offset);
var pos2 = str.toUpperCase().indexOf(needle.toUpperCase(), offset);

if (pos1 == -1 && pos2 == -1) return false;
if (pos1 == -1) pos1 = str.length + 1;
if (pos2 == -1) pos2 = str.length + 1;

return Math.min(pos1, pos2);
}

// 대소문자 구별하지 않고 뒤에서부터 단어위치 찾기
String.prototype.ripos = function (needle, offset) {
var offset = (typeof offset == "number")?offset:0;
var pos1 = str.toLowerCase().lastIndexOf(needle.toLowerCase(), offset);
var pos2 = str.toUpperCase().lastIndexOf(needle.toUpperCase(), offset);

if (pos1 == -1 && pos2 == -1) return false;
return Math.max(pos1, pos2);
}

// 문자열을 배열로
String.prototype.toArray = function () {
var len = this.length;
var arr = new Array;
for (var i=0; i<len; i++) arr[i] = this.charAt(i);
return arr;
}
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누3질답

+
제목 글쓴이 날짜 조회
21년 전 조회 502
21년 전 조회 442
21년 전 조회 370
21년 전 조회 989
21년 전 조회 471
21년 전 조회 684
21년 전 조회 425
21년 전 조회 371
21년 전 조회 383
21년 전 조회 480
21년 전 조회 455
21년 전 조회 504
21년 전 조회 560
21년 전 조회 636
21년 전 조회 490
21년 전 조회 447
21년 전 조회 467
21년 전 조회 404
21년 전 조회 429
21년 전 조회 324
🐛 버그신고